Home -> ILogger
Declaration
class ILogger;Description
The ILogger interface is the public logging surface used by application and library code to emit scoped log messages. A logger has a scope string and accepts messages tagged with an Severity value.
The interface deliberately does not specify where messages are written. Concrete implementations decide whether a severity is enabled, how child scopes are created, and how accepted messages are delivered to log targets.
String messages can be supplied as UTF-8 std::string values or native std::wstring values. Wide strings are converted to UTF-8 before the message is passed to the concrete logger implementation.
Important
Use IsLogSeverityEnabled before doing expensive work to construct a message. The built-in formatting overloads perform this check before resolving format arguments.
Warning
The format-string overloads use positional placeholders such as {0} and {1}. Placeholder values must be numeric and must refer to supplied arguments.
Enumerations
| Name | Description | |
|---|---|---|
| Severity |
Defines the severity assigned to an individual log message.
|
|
| SeverityFilter |
Defines bit-mask filters used to include or exclude messages by severity.
|
Structures
| Name | Description | |
|---|---|---|
| Deleter |
Deletes logger objects held by ILogger::unique_ptr.
|
Members
Lifetime methods
| Name | Description | |
|---|---|---|
| Delete |
Deletes the logger object. Objects are normally destroyed through ILogger::unique_ptr.
|
Scope methods
| Name | Description | |
|---|---|---|
| GetScope |
Returns the scope string assigned to the logger.
|
Severity methods
| Name | Description | |
|---|---|---|
| IsLogSeverityEnabled |
Reports whether a message with the supplied severity would currently be accepted by the logger.
|
Logger creation methods
| Name | Description | |
|---|---|---|
| CloneLogger |
Creates another logger object which logs to the same destination and scope.
|
|
| GetLoggerChildScope |
Creates a logger for a child scope below the current logger scope.
|
Logging methods
| Name | Description | |
|---|---|---|
| Log |
Logs a message using the severity supplied by the caller.
|
|
| Critical |
Logs a critical severity message.
|
|
| Error |
Logs an error severity message.
|
|
| Warning |
Logs a warning severity message.
|
|
| Info |
Logs an informational severity message.
|
|
| Debug |
Logs a debug severity message.
|
|
| Trace |
Logs a trace severity message.
|