Merge pull request #398 from i509VCB/anvil/mutex-log
anvil: Passing `ANVIL_MUTEX_LOG` uses Mutex logging drain
This commit is contained in:
commit
60fdbaebc5
|
@ -29,6 +29,10 @@
|
||||||
- EGLBufferReader now checks if buffers are alive before using them.
|
- EGLBufferReader now checks if buffers are alive before using them.
|
||||||
- LibSeat no longer panics on seat disable event.
|
- LibSeat no longer panics on seat disable event.
|
||||||
|
|
||||||
|
### Anvil
|
||||||
|
|
||||||
|
- Passing `ANVIL_MUTEX_LOG` in environment variables now uses the slower `Mutex` logging drain.
|
||||||
|
|
||||||
## version 0.3.0 (2021-07-25)
|
## version 0.3.0 (2021-07-25)
|
||||||
|
|
||||||
Large parts of Smithay were changed with numerous API changes. It is thus recommended to
|
Large parts of Smithay were changed with numerous API changes. It is thus recommended to
|
||||||
|
|
|
@ -9,11 +9,15 @@ static POSSIBLE_BACKENDS: &[&str] = &[
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
// A logger facility, here we use the terminal here
|
// A logger facility, here we use the terminal here
|
||||||
let log = slog::Logger::root(
|
let log = if std::env::var("ANVIL_MUTEX_LOG").is_ok() {
|
||||||
|
slog::Logger::root(std::sync::Mutex::new(slog_term::term_full().fuse()).fuse(), o!())
|
||||||
|
} else {
|
||||||
|
slog::Logger::root(
|
||||||
slog_async::Async::default(slog_term::term_full().fuse()).fuse(),
|
slog_async::Async::default(slog_term::term_full().fuse()).fuse(),
|
||||||
//std::sync::Mutex::new(slog_term::term_full().fuse()).fuse(),
|
|
||||||
o!(),
|
o!(),
|
||||||
);
|
)
|
||||||
|
};
|
||||||
|
|
||||||
let _guard = slog_scope::set_global_logger(log.clone());
|
let _guard = slog_scope::set_global_logger(log.clone());
|
||||||
slog_stdlog::init().expect("Could not setup log backend");
|
slog_stdlog::init().expect("Could not setup log backend");
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue