-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
zyj
committed
Sep 28, 2023
1 parent
2ebcd83
commit f8619ab
Showing
9 changed files
with
100 additions
and
97 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
use lazy_static::lazy_static; | ||
use slog::{o, Drain, Logger}; | ||
|
||
lazy_static! { | ||
pub static ref STDOUT: Logger = stdout_logger(); | ||
pub static ref STDERR: Logger = stderr_logger(); | ||
} | ||
|
||
fn stdout_logger() -> Logger { | ||
let decorator = slog_term::TermDecorator::new().build(); | ||
let drain = slog_term::CompactFormat::new(decorator).build().fuse(); | ||
let drain = slog_async::Async::new(drain).build().fuse(); | ||
|
||
Logger::root(drain, o!()) | ||
} | ||
|
||
fn stderr_logger() -> Logger { | ||
let decorator = slog_term::TermDecorator::new().build(); | ||
let drain = slog_term::CompactFormat::new(decorator).build(); | ||
let drain = std::sync::Mutex::new(drain).fuse(); | ||
|
||
Logger::root(drain, o!()) | ||
} |
Oops, something went wrong.