LoggerOptions
mach::LoggerOptions
Description
Section titled “Description”Configures the built-in Mach logger.
Headers
Section titled “Headers”Primary header:
#include <mach/LoggerOptions.hpp>Convenience header:
#include <mach/mach.hpp>Syntax
Section titled “Syntax”struct LoggerOptions { LogLevel level = LogLevel::Info; std::string pattern = "[%Y-%m-%d %H:%M:%S] [%^%l%$] %v"; bool enableColors = true;};Data Members
Section titled “Data Members”| Name | Description |
|---|---|
level |
The minimum log level to record. |
pattern |
The log message formatting pattern. |
enableColors |
Whether log messages are formatted using colours. |
Thread Safety
Section titled “Thread Safety”Not thread-safe. Concurrent access to the same LoggerOptions instance must be synchronized externally.
Remarks
Section titled “Remarks”LoggerOptions is used by AppBuilder::configureLogging() to configure the built-in Mach logger.
Example
Section titled “Example”builder.configureLogging([](mach::LoggerOptions& options) { options.logLevel = mach::LogLevel::Debug; options.enableColors = false; options.pattern = "[%Y-%m-%d %H:%M:%S] [%^%l%$] %v";});See Also
Section titled “See Also”| Name | Description |
|---|---|
Logger |
Writes log messages using the configured logger. |
LogLevel |
Represents the severity of a log message. |