Class LoggerClass
Defined in File RtLog.hpp
Class Documentation
-
class LoggerClass
Logger class.
Public Types
-
typedef std::shared_ptr<LoggerClass> Ptr
Public Functions
-
LoggerClass(std::string logger_name)
-
LoggerClass(std::string logger_name, OnPrintCallback f)
-
~LoggerClass()
-
std::ostream &log()
Writes to the internal stream with no special formatting and without changing the severity level (which defaults to HIGH).
- Returns
Reference to std::ostream (it enables to leverage the same interface as std::cout / cerr)
-
std::ostream &info(Logger::Severity s = Logger::Severity::LOW)
Logs an information message (with bold [INFO] header).
- Parameters
s – Message severity. Defaults to LOW.
- Returns
Reference to std::ostream (it enables to leverage the same interface as std::cout / cerr)
-
void info(Logger::Severity s, const char *fmt, ...)
Logs an information message (with bold [INFO] header).
- Parameters
s – Message severity. Defaults to LOW.
fmt – Formatted string (printf-like)
... – Values for the formatted string (printf-like)
-
void info(const char *fmt, ...)
Logs an information message (with bold [INFO] header).
- Parameters
fmt – Formatted string (printf-like)
-
std::ostream &error(Logger::Severity s = Logger::Severity::HIGH)
Logs an error message (in red, with bold [ERROR] header).
- Parameters
s – Message severity. Defaults to HIGH.
- Returns
Reference to std::ostream (it enables to leverage the same interface as std::cout / cerr)
-
void error(Logger::Severity s, const char *fmt, ...)
Logs an error message (with bold [ERROR] header).
- Parameters
s – Message severity. Defaults to HIGH.
fmt – Formatted string (printf-like)
... – Values for the formatted string (printf-like)
-
void error(const char *fmt, ...)
Logs an error message (with bold [ERROR] header).
- Parameters
fmt – Formatted string (printf-like)
-
std::ostream &warning(Logger::Severity s = Logger::Severity::MID)
Logs a warning message (in yellow, with bold [WARNING] header).
- Parameters
s – Message severity. Defaults to MEDIUM.
- Returns
Reference to std::ostream (it enables to leverage the same interface as std::cout / cerr)
-
void warning(Logger::Severity s, const char *fmt, ...)
Logs an warning message (with bold [warning] header).
- Parameters
s – Message severity. Defaults to MEDIUM.
fmt – Formatted string (printf-like)
... – Values for the formatted string (printf-like)
-
void warning(const char *fmt, ...)
Logs an warning message (with bold [warning] header).
- Parameters
fmt – Formatted string (printf-like)
-
std::ostream &success(Logger::Severity s = Logger::Severity::LOW)
Logs a success message (in green, with bold [OK] header).
- Parameters
s – Message severity. Defaults to LOW.
- Returns
Reference to std::ostream (it enables to leverage the same interface as std::cout / cerr)
-
void success(Logger::Severity s, const char *fmt, ...)
Logs a success message (with bold [success] header).
- Parameters
s – Message severity. Defaults to LOW.
fmt – Formatted string (printf-like)
... – Values for the formatted string (printf-like)
-
void success(const char *fmt, ...)
Logs a success message (with bold [success] header).
- Parameters
fmt – Formatted string (printf-like)
-
void setVerbosityLevel(Logger::Severity s)
Sets the global verbosity level, i.e.
the minimum severity that a message must have in order to actually be printed.
Friends
- friend class Endl
- friend class Logger
-
typedef std::shared_ptr<LoggerClass> Ptr