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

A single logging operation of a Logger using a specified LOGLEVEL.

A (more or less) thread-safe, type-safe, portable logging interface for concrete Loggers.

Public static functions

static auto from_string(const std::string& level) -> LOGLEVEL
Turns a string representation of the log level to a LOGLEVEL instance.
static auto to_string(LOGLEVEL level) -> std::string
Turns a LOGLEVEL instance into a string representation.

Constructors, destructors, conversion operators

Log(const Log&) deleted
Class is non-copyable.
Log(const Logger& logger, LOGLEVEL msg_level)
Constructor.
Log(Log&&) deleted
Class is non-movable.
~Log() noexcept
Destructor.

Public functions

auto get() -> std::ostringstream&
Get the output stream to write to.

Function documentation

static LOGLEVEL arcstk::v_1_0_0::Log::from_string(const std::string& level)

Turns a string representation of the log level to a LOGLEVEL instance.

Parameters
level in The name of the log level to create
Returns The log level represented by the string or the default log level

static std::string arcstk::v_1_0_0::Log::to_string(LOGLEVEL level)

Turns a LOGLEVEL instance into a string representation.

Parameters
level in The log level to turn to a string
Returns A string representation of the log level

arcstk::v_1_0_0::Log::Log(const Logger& logger, LOGLEVEL msg_level)

Constructor.

Parameters
logger in Logger to use
msg_level in Loglevel of the message to log

std::ostringstream& arcstk::v_1_0_0::Log::get()

Get the output stream to write to.

Returns Get the output stream to write to