Class Logger

Class Documentation

class Logger

Todo:

for asynchronous logging, make the logger an active object according to Herb Sutter https://herbsutter.com/2010/07/12/effective-concurrency-prefer-using-active-objects-instead-of-naked-threads/

Public Functions

Logger(Logger &&other) noexcept
Logger &operator=(Logger &&rhs) noexcept
Logger(const Logger &other) = delete
Logger &operator=(const Logger &rhs) = delete
LogLevel GetLogLevel() const noexcept

Getter method for the current LogLevel.

Returns:

the current LogLevel

void SetLogLevel(const LogLevel logLevel) noexcept

Sets the LogLevel for the Logger.

Parameters:

logLevel[in] to be set

cxx::GenericRAII SetLogLevelForScope(const LogLevel logLevel) noexcept

Sets the LogLevel to the given level for the lifetime of the GenericRAII object and then sets it back to the previous one.

Parameters:

logLevel[in] to be set temporarily

Returns:

a scope guard which resets the LogLevel to the value at the time when this method was called

void SetLogMode(const LogMode logMode) noexcept
bool IsEnabled(const LogLevel logLevel) const noexcept
LogStream LogFatal() noexcept
LogStream LogError() noexcept
LogStream LogWarn() noexcept
LogStream LogInfo() noexcept
LogStream LogDebug() noexcept
LogStream LogVerbose() noexcept

Protected Functions

Logger(const std::string &ctxId, const std::string &ctxDescription, const LogLevel appLogLevel) noexcept
virtual void Log(const LogEntry &entry) const noexcept