Class LoggerConfig

Class Documentation

class LoggerConfig

LoggerConfig defines various configurable aspects of a Logger’s behavior. This class should not be used directly to configure a Logger’s behavior, instead a ScopeConfigurator should be used to compute the desired LoggerConfig which can then be used to configure a Logger.

Public Functions

bool operator==(const LoggerConfig &other) const noexcept
bool IsEnabled() const noexcept

Returns if the Logger is enabled or disabled. Loggers are enabled by default.

Returns:

a boolean indicating if the Logger is enabled. Defaults to true.

Public Static Functions

static LoggerConfig Enabled()

Returns a LoggerConfig that represents an enabled Logger.

Returns:

a static constant LoggerConfig that represents an enabled logger.

static LoggerConfig Disabled()

Returns a LoggerConfig that represents a disabled Logger. A disabled logger behaves like a no-op logger.

Returns:

a static constant LoggerConfig that represents a disabled logger.

static LoggerConfig Default()

Returns a LoggerConfig that represents a Logger configured with the default behavior. The default behavior is guided by the OpenTelemetry specification.

Returns:

a static constant LoggerConfig that represents a logger configured with default behavior.