30 #if !defined(_Logging_h_) 113 virtual void log(
const char *fmt, ...);
117 virtual void log(
const std::string &msg) {
log(msg.c_str()); }
124 virtual void log(
const char *fmt, va_list args);
127 virtual void log(
log_level_t level,
const char *fmt, va_list args);
136 virtual void _log(
const char *msg) = 0;
157 static inline Logger *getLogger() {
return s_logger; }
165 static void log(
const char *fmt, ...);
169 static void log(
const std::string &msg);
182 static void urgent(
const char *fmt, ...);
183 static void json(
const char *fmt, ...);
184 static void error(
const char *fmt, ...);
185 static void warning(
const char *fmt, ...);
186 static void info(
const char *fmt, ...);
187 static void info2(
const char *fmt, ...);
188 static void debug(
const char *fmt, ...);
189 static void debug2(
const char *fmt, ...);
223 : m_logger(
Log::getLogger())
227 m_saved = m_logger->getOutputLevel();
228 m_logger->setOutputLevel(level);
240 m_logger->setOutputLevel(level);
260 virtual void _log(
const char *msg);
274 virtual void _log(
const char *msg);
284 #endif // _Logging_h_ The normal log level, for status messages.
Definition: src/blfwk/Logging.h:81
virtual ~Logger()
Destructor.
Definition: src/blfwk/Logging.h:98
SetOutputLevel(Logger::log_level_t level)
Default constructor.
Definition: src/blfwk/Logging.h:222
log_level_t getFilterLevel() const
Returns the current logging filter level.
Definition: src/blfwk/Logging.h:104
For fatal error messages.
Definition: src/blfwk/Logging.h:79
For internal reporting.
Definition: src/blfwk/Logging.h:83
static void setLogger(Logger *logger)
Sets the global logger singleton instance.
Definition: src/blfwk/Logging.h:160
std::ofstream m_logFile
The name of the file, including the path, to log to.
Definition: src/blfwk/Logging.h:279
Alias for kDebug.
Definition: src/blfwk/Logging.h:86
log_level_t m_level
The current log output level.
Definition: apps/elftosb/common/Logging.h:102
virtual void log(log_level_t level, const std::string &msg)
Log a string output at a specific output level.
Definition: src/blfwk/Logging.h:122
SetOutputLevel(Logger *logger, Logger::log_level_t level)
Constructor.
Definition: src/blfwk/Logging.h:235
log_level_t getOutputLevel() const
Returns the current logging output level.
Definition: src/blfwk/Logging.h:108
Alias for kInfo.
Definition: src/blfwk/Logging.h:85
For machine language output only.
Definition: src/blfwk/Logging.h:78
void setFilterLevel(log_level_t level)
Changes the logging level to level.
Definition: apps/elftosb/common/Logging.h:72
~SetOutputLevel()
Destructor.
Definition: src/blfwk/Logging.h:246
virtual void log(const std::string &msg)
Log a string object.
Definition: src/blfwk/Logging.h:117
The lowest level, for messages that must always be logged.
Definition: src/blfwk/Logging.h:77
Wraps a set of static functions for easy global logging access.
Definition: apps/elftosb/common/Logging.h:122
For verbose status messages.
Definition: src/blfwk/Logging.h:82
For non-fatal warning messages.
Definition: src/blfwk/Logging.h:80
virtual void log(const char *fmt,...)
Log with format.
Definition: apps/elftosb/common/Logging.cpp:16
void setOutputLevel(log_level_t level)
Changes the logging output level to level.
Definition: src/blfwk/Logging.h:106
const std::string m_file_path
The name of the file, including the path, to log to.
Definition: src/blfwk/Logging.h:277
Logger()
Default constructor.
Definition: src/blfwk/Logging.h:91
Highest log level; verbose debug logging.
Definition: src/blfwk/Logging.h:84
log_level_t m_filter
The current logging filter level.
Definition: apps/elftosb/common/Logging.h:101
log_level_t
Logging levels.
Definition: apps/elftosb/common/Logging.h:48
virtual void _log(const char *msg)=0
The base pure virtual logging function implemented by subclasses.
Simple logger that writes to stdout.
Definition: apps/elftosb/common/Logging.h:212
Utility class to temporarily change the logging output level.
Definition: apps/elftosb/common/Logging.h:171
Simple logger that writes to a file.
Definition: src/blfwk/Logging.h:266
Base logger class.
Definition: apps/elftosb/common/Logging.h:44