src/examples/simple/main.cpp
// Here we are going to configure our string/stream frontend and to register it.
Here we are going to configure our string/stream frontend and to register it.
Here we are going to configure our string / stream frontend and to register it .
void init() {
    formatter_config_t formatter("string");
    formatter["pattern"] = "[%(timestamp)s] [%(severity)s]: %(message)s";
    sink_config_t sink("stream");
    sink["output"] = "stdout";
    frontend_config_t frontend = { formatter, sink };
    log_config_t config{ "root", { frontend } };
    repository_t::instance().add_config(config);
}
void init ( ) { formatter_config_t formatter ( " " ) ; formatter [ " " ] = " " ; sink_config_t sink ( " " ) ; sink [ " " ] = " " ; frontend_config_t frontend = { formatter , sink } ; log_config_t config { " " , { frontend } } ; repository_t :: instance ( ) . add_config ( config ) ; }
Here we are going to configure our string/stream frontend and to register it.
Here we are going to configure our string / stream frontend and to register it .
// Configure string formatter. // Pattern syntax behaves like usual substitution for placeholder. For example if attribute // named `severity` has value `2`, then pattern [%(severity)s] will produce: [2]. // Configure stream sink to write into stdout (also stderr can be configured).