Stride Reference Manual  - generated for commit 9643b11
LogUtils.h
Go to the documentation of this file.
1 /*
2  * This is free software: you can redistribute it and/or modify it
3  * under the terms of the GNU General Public License as published by
4  * the Free Software Foundation, either version 3 of the License, or
5  * any later version.
6  * The software is distributed in the hope that it will be useful,
7  * but WITHOUT ANY WARRANTY; without even the implied warranty of
8  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
9  * GNU General Public License for more details.
10  * You should have received a copy of the GNU General Public License
11  * along with the software. If not, see <http://www.gnu.org/licenses/>.
12  *
13  * Copyright 2017, Kuylen E, Willem L, Broeckhove J
14  */
15 
21 #pragma once
22 
23 #include <memory>
24 #include <spdlog/spdlog.h>
25 #include <string>
26 
27 namespace stride {
28 namespace util {
29 
33 class LogUtils
34 {
35 public:
39  static std::shared_ptr<spdlog::logger> CreateCliLogger(const std::string& logger_name,
40  const std::string& file_name);
41 
45  static std::shared_ptr<spdlog::logger> CreateFileLogger(const std::string& logger_name,
46  const std::string& file_name);
49  static std::shared_ptr<spdlog::logger> CreateNullLogger(const std::string& logger_name = "null_logger");
50 
53  static std::shared_ptr<spdlog::logger> CreateRotatingLogger(const std::string& logger_name,
54  const std::string& file_name);
55 };
56 
57 } // namespace util
58 } // namespace stride
Utilities for logging (spdlog).
Definition: LogUtils.h:33
static std::shared_ptr< spdlog::logger > CreateCliLogger(const std::string &logger_name, const std::string &file_name)
Return a (not-yet-registered) commandline and file logger, without registering it.
Definition: LogUtils.cpp:32
static std::shared_ptr< spdlog::logger > CreateRotatingLogger(const std::string &logger_name, const std::string &file_name)
Return a (not-yet-registered) rotating logger, without registering it.
Definition: LogUtils.cpp:88
static std::shared_ptr< spdlog::logger > CreateFileLogger(const std::string &logger_name, const std::string &file_name)
Return a (not-yet-registered) file logger, without registering it.
Definition: LogUtils.cpp:53
Namespace for the simulator and related classes.
Definition: Calendar.cpp:28
static std::shared_ptr< spdlog::logger > CreateNullLogger(const std::string &logger_name="null_logger")
Return a (not-yet-registered) null logger, without registering it.
Definition: LogUtils.cpp:71