arcstk::v_1_0_0::Logger class final
#include <logging.hpp>

Logs a message to its registered Appenders.

A Logger associates a configuration with a set of Appenders. Can be configured to log timestamps. The default is true.

Constructors, destructors, conversion operators

Logger()
Constructor.
Logger(const Logger&) deleted
Logger is non-copyable.
Logger(Logger&& rhs) noexcept
Default move constructor.
~Logger() noexcept
Default destructor.

Public functions

void add_appender(std::unique_ptr<Appender> appender)
Add an Appender to this Logger.
auto has_timestamps() const -> bool noexcept
Returns TRUE iff this instance is configured to log timestamps.
void log(const std::string& msg) const
Log the given message to all Appenders.
void remove_appender(const Appender* appender)
Remove the given Appender from this Logger.
void set_timestamps(const bool& onoff) noexcept
Activates or deactivates the output of timestamps.

Function documentation

arcstk::v_1_0_0::Logger::Logger(Logger&& rhs) noexcept

Default move constructor.

Parameters
rhs in The instance to move

void arcstk::v_1_0_0::Logger::add_appender(std::unique_ptr<Appender> appender)

Add an Appender to this Logger.

Parameters
appender in An Appender to use

bool arcstk::v_1_0_0::Logger::has_timestamps() const noexcept

Returns TRUE iff this instance is configured to log timestamps.

Returns TRUE iff this instance will log timestamps.

void arcstk::v_1_0_0::Logger::log(const std::string& msg) const

Log the given message to all Appenders.

Parameters
msg in The message to log

void arcstk::v_1_0_0::Logger::remove_appender(const Appender* appender)

Remove the given Appender from this Logger.

Parameters
appender in An Appender to remove

void arcstk::v_1_0_0::Logger::set_timestamps(const bool& onoff) noexcept

Activates or deactivates the output of timestamps.

Parameters
onoff in TRUE activates the logging of timestamps for this logger