Go to the documentation of this file.
28 #ifndef _LOG4TANGO_LOGGER_H
29 #define _LOG4TANGO_LOGGER_H
40 #ifndef LOG4TANGO_LOGGERS_USE_LOGSTREAM
46 #ifdef LOG4TANGO_LOGGERS_USE_LOGSTREAM
65 Logger(
const std::string& name,
102 return _level >= level;
112 const char* string_format, ...);
121 if (is_level_enabled(level)) {
122 log_unconditionally(level, message);
133 const char* string_format, ...);
141 const std::string& message);
148 void debug (
const char* string_format, ...);
154 inline void debug (
const std::string& message) {
168 #ifndef LOG4TANGO_LOGGERS_USE_LOGSTREAM
182 return *_log_streams[_DEBUG_STREAM_ID];
191 void info (
const char* string_format, ...);
197 inline void info (
const std::string& message) {
211 #ifndef LOG4TANGO_LOGGERS_USE_LOGSTREAM
225 return *_log_streams[_INFO_STREAM_ID];
234 void warn (
const char* string_format, ...);
240 inline void warn (
const std::string& message) {
254 #ifndef LOG4TANGO_LOGGERS_USE_LOGSTREAM
268 return *_log_streams[_WARN_STREAM_ID];
277 void error (
const char* string_format, ...);
283 inline void error (
const std::string& message) {
297 #ifndef LOG4TANGO_LOGGERS_USE_LOGSTREAM
311 return *_log_streams[_ERROR_STREAM_ID];
320 void fatal(
const char* string_format, ...);
326 inline void fatal (
const std::string& message) {
340 #ifndef LOG4TANGO_LOGGERS_USE_LOGSTREAM
354 return *_log_streams[_FATAL_STREAM_ID];
358 #ifndef LOG4TANGO_LOGGERS_USE_LOGSTREAM
382 #ifdef LOG4TANGO_LOGGERS_USE_LOGSTREAM
385 _FATAL_STREAM_ID = 0,
386 _ERROR_STREAM_ID = 1,
394 const std::string _name;
399 #ifdef LOG4TANGO_LOGGERS_USE_LOGSTREAM
401 LogStream *_log_streams[5];
411 #endif // _LOG4TANGO_LOGGER_H
bool is_debug_enabled(void) const
Return true if the Logger will log messages with level DEBUG.
Definition: Logger.hh:164
void warn(const std::string &message)
Log a message with warn level.
Definition: Logger.hh:240
bool is_error_enabled(void) const
Return true if the Logger will log messages with level ERROR.
Definition: Logger.hh:293
@ DEBUG
Definition: Level.hh:92
@ INFO
Definition: Level.hh:91
LoggerStream fatal_stream(void)
Return a LoggerStream with level FATAL.
Definition: Logger.hh:345
bool is_info_enabled(void) const
Return true if the Logger will log messages with level INFO.
Definition: Logger.hh:207
LoggerStream warn_stream(void)
Return a LoggerStream with level WARN.
Definition: Logger.hh:259
const std::string & get_name() const
Return the logger name.
Definition: Logger.hh:77
void fatal(const std::string &message)
Log a message with fatal level.
Definition: Logger.hh:326
void debug(const std::string &message)
Log a message with debug level.
Definition: Logger.hh:154
bool is_warn_enabled(void) const
Return true if the Logger will log messages with level WARN.
Definition: Logger.hh:250
LoggerStream info_stream(void)
Return a LoggerStream with level INFO.
Definition: Logger.hh:216
Definition: LogStream.hh:46
The internal representation of logging events.
Definition: LoggingEvent.hh:50
void info(const std::string &message)
Log a message with info level.
Definition: Logger.hh:197
Definition: Appender.hh:40
Definition: AppenderAttachable.hh:58
bool is_fatal_enabled(void) const
Return true if the Logger will log messages with level FATAL.
Definition: Logger.hh:336
Definition: LoggerStream.hh:58
#define LOG4TANGO_EXPORT
Definition: Export.hh:38
@ WARN
Definition: Level.hh:90
void log(Level::Value level, const std::string &message)
Log a message with the specified level.
Definition: Logger.hh:119
@ OFF
Definition: Level.hh:87
LoggerStream get_stream(Level::Value level, bool filter=true)
Return a LoggerStream with given Level.
Definition: Logger.hh:365
LoggerStream error_stream(void)
Return a LoggerStream with level ERROR.
Definition: Logger.hh:302
int Value
The type of Level Values.
Definition: Level.hh:98
@ FATAL
Definition: Level.hh:88
void error(const std::string &message)
Log a message with error level.
Definition: Logger.hh:283
class LOG4TANGO_EXPORT Logger
Definition: LoggerStream.hh:43
bool is_level_enabled(Level::Value level) const
Returns true if the level of the Logger is equal to or higher than given level.
Definition: Logger.hh:101
LoggerStream debug_stream(void)
Return a LoggerStream with level DEBUG.
Definition: Logger.hh:173
@ ERROR
Definition: Level.hh:89
Level::Value get_level() const
Returns the assigned Level, if any, for this Logger.
Definition: Logger.hh:91