-
Notifications
You must be signed in to change notification settings - Fork 18
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support for record format #22
Comments
|
Thanks. Any suggestions on how to override? I have been using slog with implementing log trait for a drain but missing some of the common capabilities of sloggers. E.g. log rotate, keep num of files, compression etc |
I tried adding #[macro_use]
extern crate slog;
extern crate sloggers;
use sloggers::BuildWithCustomFormat; // Added
use sloggers::terminal::{TerminalLoggerBuilder, Destination};
let mut builder = TerminalLoggerBuilder::new();
builder.destination(Destination::Stderr);
let logger = builder.build_with_custom_format(|decorator| {
let drain = ...; // Create your own drain that uses `decorator` (slog_term::Decorator).
Ok(drain)
})).unwrap();
info!(logger, "Hello World!"); Is it sufficient for you? |
Thanks, I will give a try. Appreciate your help. |
How do I format a record as
Timestamp|Level|Module:Line|Msg
e.g.
2019-03-14T07:13:58.740|INFO|abc::network_server:97|Starting connection handler child loop
The text was updated successfully, but these errors were encountered: