log async

This commit is contained in:
Dmitry Belyaev 2022-09-24 23:55:38 +03:00
parent 155e54baf0
commit 06d9373d4b
Signed by: b4tman
GPG Key ID: 41A00BF15EA7E5F3

View File

@ -45,7 +45,7 @@ macro_rules! handle_error {
fn main() { fn main() {
let args = Cli::parse(); let args = Cli::parse();
Logger::try_with_str("info") let _logger = Logger::try_with_str("info")
.unwrap() .unwrap()
.log_to_file( .log_to_file(
FileSpec::default().directory(std::env::current_exe().unwrap().parent().unwrap()), FileSpec::default().directory(std::env::current_exe().unwrap().parent().unwrap()),
@ -59,6 +59,7 @@ fn main() {
.adaptive_format_for_stderr(AdaptiveFormat::Detailed) .adaptive_format_for_stderr(AdaptiveFormat::Detailed)
.print_message() .print_message()
.duplicate_to_stderr(Duplicate::Warn) .duplicate_to_stderr(Duplicate::Warn)
.write_mode(flexi_logger::WriteMode::Async)
.start_with_specfile( .start_with_specfile(
std::env::current_exe() std::env::current_exe()
.unwrap() .unwrap()