neic-glass3  1.4.6
logger.h
Go to the documentation of this file.
1 /*****************************************
2  * This file is documented for Doxygen.
3  * If you modify this file please update
4  * the comments so that Doxygen will still
5  * be able to work.
6  ****************************************/
17 #ifndef LOGGER_H
18 #define LOGGER_H
19 
20 #include <spdlog.h>
21 #include <string>
22 
23 namespace glass3 {
24 namespace util {
25 
32 class Logger {
33  public:
39  Logger();
40 
46  ~Logger();
47 
51  static void disable();
52 
56  static void enable();
57 
75  static spdlog::level::level_enum string_to_log_level(
76  const std::string &levelString);
77 
94  static void log_init(const std::string &programName,
95  const std::string &logLevel,
96  const std::string &logPath, bool logConsole = true);
97 
106  static void log_update_level(spdlog::level::level_enum loglevel);
107 
121  static void log_update_level(const std::string &levelString);
122 
131  static void log(const char * logMessage);
132 
143  static void log(const std::string &level, const char * logMessage);
144 
153  static void log(std::string logMessage);
154 
167  static void log(const std::string &level, const std::string &message);
168 
176  static void logInfo(const std::string &message);
177 
185  static void logTrace(const std::string &message);
186 
194  static void logDebug(const std::string &message);
195 
203  static void logWarning(const std::string &message);
204 
212  static void logError(const std::string &message);
213 
221  static void logCriticalError(const std::string &message);
222 
226  static bool m_bDisable;
227 
228  // constants
232  static const unsigned int k_nMaxLogEntrySize = 1024;
233 };
234 } // namespace util
235 } // namespace glass3
236 #endif // LOGGER_H
glassutil logging class
Definition: logger.h:32
static void logInfo(const std::string &message)
log a message at info level
Definition: logger.cpp:176
static const unsigned int k_nMaxLogEntrySize
The maximum size of a constructed (via sprintf) log entry.
Definition: logger.h:232
static void logError(const std::string &message)
log a message at error level
Definition: logger.cpp:264
static void logTrace(const std::string &message)
log a message at trace level
Definition: logger.cpp:198
static void logCriticalError(const std::string &message)
log a message at critical error level
Definition: logger.cpp:287
The neic-glass3 project namespace containing all the classes and functions that make up neic-glass3...
~Logger()
Logger destructor.
Definition: logger.cpp:20
static spdlog::level::level_enum string_to_log_level(const std::string &levelString)
convert string level to spdlog level
Definition: logger.cpp:34
static void logWarning(const std::string &message)
log a message at warning level
Definition: logger.cpp:242
static void log_init(const std::string &programName, const std::string &logLevel, const std::string &logPath, bool logConsole=true)
initialize logging
Definition: logger.cpp:57
static void log(const char *logMessage)
logging function
Definition: logger.cpp:141
static void log_update_level(spdlog::level::level_enum loglevel)
update log level
Definition: logger.cpp:118
static bool m_bDisable
A boolean flag to disable all logging.
Definition: logger.h:226
Logger()
Logger constructor.
Definition: logger.cpp:16
static void enable()
Logger enable logging function.
Definition: logger.cpp:29
static void logDebug(const std::string &message)
log a message at debug level
Definition: logger.cpp:220
static void disable()
Logger disable logging function.
Definition: logger.cpp:24