Class Logger

Class Documentation

class Logger

Public Types

enum class Level

An enum for the type of logger level.

Values:

enumerator Unset

The unset log level.

enumerator Debug

The debug log level.

enumerator Info

The info log level.

enumerator Warn

The warn log level.

enumerator Error

The error log level.

enumerator Fatal

The fatal log level.

Public Functions

Logger(const Logger&) = default
inline const char *get_name() const

Get the name of this logger.

Returns:

the full name of the logger including any prefixes, or

Returns:

nullptr if this logger is invalid (e.g. because logging is disabled).

inline Logger get_child(const std::string &suffix)

Return a logger that is a descendant of this logger.

The child logger’s full name will include any hierarchy conventions that indicate it is a descendant of this logger. For example, get_logger('abc').get_child('def') will return a logger with name abc.def.

Parameters:

suffix[in] the child logger’s suffix

Returns:

a logger with the fully-qualified name including the suffix, or

Returns:

a dummy logger if this logger is invalid (e.g. because logging is disabled).

void set_level(Level level)

Set level for current logger.

Parameters:

level[in] the logger’s level

Throws: