提交 cc5060a1 authored 作者: Serhij S's avatar Serhij S

custom log format for systemd

上级 80fd2936
#![ doc = include_str!( concat!( env!( "CARGO_MANIFEST_DIR" ), "/", "README.md" ) ) ]
use core::{fmt, num};
use std::io::Write;
use std::{env, mem, str::FromStr, sync::Arc, time::Duration};
use thread_rt::{RTParams, Scheduling};
......@@ -244,7 +245,7 @@ pub fn configure_logger(filter: LevelFilter) {
builder.target(env_logger::Target::Stdout);
builder.filter_level(filter);
if is_production() {
builder.format_timestamp(None);
builder.format(|buf, record| writeln!(buf, "{} {}", record.level(), record.args()));
}
builder.init();
}
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论