You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
let log_path = "your_log_file_path.log";
let file = OpenOptions::new()
.create(true)
.write(true)
.truncate(true)
.open(log_path)
.unwrap();
let file_decorator = slog_term::PlainDecorator::new(file);
let file_drain = slog_term::FullFormat::new(file_decorator).build().fuse();
let file_drain = slog_async::Async::new(file_drain).build().fuse();
let term_decorator = slog_term::TermDecorator::new().build();
let term_drain = slog_term::FullFormat::new(term_decorator).build().fuse();
let term_drain = slog_async::Async::new(term_drain).build().fuse();
let logger = slog::Logger::root(slog::Duplicate::new(file_drain, term_drain).fuse(), o!("version" => env!("CARGO_PKG_VERSION")));
let _scope_guard = slog_scope::set_global_logger(logger);
let _log_guard = slog_stdlog::init().unwrap();
info!("Starting program...");
Logs in file looks good and also when I run app from linux terminal too.
Clion: 2020.2.1
The text was updated successfully, but these errors were encountered:
That's something to do with color handling, which is automatically not being done when logging to non-TTY device. I wonder if it's slog printing something weird, or just clion terminal emulator.
When using other loggers like fern, everything works perfect. I also turn on terminal emulation in clion. It looks like slog handle colors in the other way.
Hello!
I noticed very strange bug.
My code:
Logs in file looks good and also when I run app from linux terminal too.
Clion: 2020.2.1
The text was updated successfully, but these errors were encountered: