Skip to content
Download

LoggerOptions

mach::LoggerOptions

Configures the built-in Mach logger.

Primary header:

#include <mach/LoggerOptions.hpp>

Convenience header:

#include <mach/mach.hpp>
struct LoggerOptions {
LogLevel level = LogLevel::Info;
std::string pattern = "[%Y-%m-%d %H:%M:%S] [%^%l%$] %v";
bool enableColors = true;
};
Name Description
level The minimum log level to record.
pattern The log message formatting pattern.
enableColors Whether log messages are formatted using colours.

Not thread-safe. Concurrent access to the same LoggerOptions instance must be synchronized externally.

LoggerOptions is used by AppBuilder::configureLogging() to configure the built-in Mach logger.

builder.configureLogging([](mach::LoggerOptions& options) {
options.logLevel = mach::LogLevel::Debug;
options.enableColors = false;
options.pattern = "[%Y-%m-%d %H:%M:%S] [%^%l%$] %v";
});
Name Description
Logger Writes log messages using the configured logger.
LogLevel Represents the severity of a log message.