Demonstrate adding custom logging options to a server (using glog as the example)
{
static char const* const glog = "glog";
static char const* const glog_stderrthreshold = "glog-stderrthreshold";
static char const* const glog_minloglevel = "glog-minloglevel";
static char const* const glog_log_dir = "glog-log-dir";
static int const glog_stderrthreshold_default = 2;
static int const glog_minloglevel_default = 0;
static char const* const glog_log_dir_default = "";
"Copy log messages at or above this level "
"to stderr in addition to logfiles. The numbers "
"of severity levels INFO, WARNING, ERROR, and "
"FATAL are 0, 1, 2, and 3, respectively.",
glog_stderrthreshold_default);
"Log messages at or above this level. The numbers "
"of severity levels INFO, WARNING, ERROR, and "
"FATAL are 0, 1, 2, and 3, respectively.",
glog_minloglevel_default);
[&]() -> std::shared_ptr<ml::Logger>
{
{
return std::make_shared<me::GlogLogger>(
"mir",
}
else
{
return std::shared_ptr<ml::Logger>{};
}
});
}