Console logger example
void ConfigureLogger()
{
auto sink = std::make_shared<CppLogging::Processor>(std::make_shared<CppLogging::TextLayout>());
sink->appenders().push_back(std::make_shared<CppLogging::ConsoleAppender>());
}
int main(int argc, char** argv)
{
ConfigureLogger();
logger.
Debug(
"Debug message");
logger.
Info(
"Info message");
logger.
Warn(
"Warning message");
logger.
Error(
"Error message");
logger.
Fatal(
"Fatal message");
return 0;
}
static void ConfigLogger(const std::shared_ptr< Processor > &sink)
Configure default logger with a given logging sink processor.
static void Startup()
Startup the logging infrastructure.
void Warn(std::string_view message) const
Log warning message.
void Debug(std::string_view message) const
Log debug message.
void Fatal(std::string_view message) const
Log fatal message.
void Error(std::string_view message) const
Log error message.
void Info(std::string_view message) const
Log information message.
Logger configuration definition.
Logger interface definition.