mirror of
https://github.com/scottlamb/moonfire-nvr.git
synced 2025-10-28 23:35:02 -04:00
fix missing log lines
...by using a global rather than per-layer filter with `tracing`.
This commit is contained in:
parent
239256e2ba
commit
7968700aae
@ -8,6 +8,11 @@ upgrades, e.g. `v0.6.x` -> `v0.7.x`. The config file format and
|
|||||||
[API](ref/api.md) currently have no stability guarantees, so they may change
|
[API](ref/api.md) currently have no stability guarantees, so they may change
|
||||||
even on minor releases, e.g. `v0.7.5` -> `v0.7.6`.
|
even on minor releases, e.g. `v0.7.5` -> `v0.7.6`.
|
||||||
|
|
||||||
|
## unreleased
|
||||||
|
|
||||||
|
* switch from per-layer to global `tracing` filter to avoid missing log lines
|
||||||
|
(tokio-rs/tracing#2519)[https://github.com/tokio-rs/tracing/issues/2519]).
|
||||||
|
|
||||||
## v0.7.21 (2025-04-04)
|
## v0.7.21 (2025-04-04)
|
||||||
|
|
||||||
* Release with `mimalloc` allocator, which is significantly faster than the memory
|
* Release with `mimalloc` allocator, which is significantly faster than the memory
|
||||||
|
|||||||
@ -122,33 +122,36 @@ pub fn install() {
|
|||||||
|
|
||||||
match std::env::var("MOONFIRE_FORMAT") {
|
match std::env::var("MOONFIRE_FORMAT") {
|
||||||
Ok(s) if s == "systemd" => {
|
Ok(s) if s == "systemd" => {
|
||||||
let sub = tracing_subscriber::registry().with(
|
let sub = tracing_subscriber::registry()
|
||||||
tracing_subscriber::fmt::Layer::new()
|
.with(
|
||||||
.with_writer(std::io::stderr)
|
tracing_subscriber::fmt::Layer::new()
|
||||||
.with_ansi(false)
|
.with_writer(std::io::stderr)
|
||||||
.event_format(FormatSystemd)
|
.with_ansi(false)
|
||||||
.with_filter(filter),
|
.event_format(FormatSystemd),
|
||||||
);
|
)
|
||||||
|
.with(filter);
|
||||||
tracing::subscriber::set_global_default(sub).unwrap();
|
tracing::subscriber::set_global_default(sub).unwrap();
|
||||||
}
|
}
|
||||||
Ok(s) if s == "json" => {
|
Ok(s) if s == "json" => {
|
||||||
let sub = tracing_subscriber::registry().with(
|
let sub = tracing_subscriber::registry()
|
||||||
tracing_subscriber::fmt::Layer::new()
|
.with(
|
||||||
.with_writer(std::io::stderr)
|
tracing_subscriber::fmt::Layer::new()
|
||||||
.with_thread_names(true)
|
.with_writer(std::io::stderr)
|
||||||
.json()
|
.with_thread_names(true)
|
||||||
.with_filter(filter),
|
.json(),
|
||||||
);
|
)
|
||||||
|
.with(filter);
|
||||||
tracing::subscriber::set_global_default(sub).unwrap();
|
tracing::subscriber::set_global_default(sub).unwrap();
|
||||||
}
|
}
|
||||||
_ => {
|
_ => {
|
||||||
let sub = tracing_subscriber::registry().with(
|
let sub = tracing_subscriber::registry()
|
||||||
tracing_subscriber::fmt::Layer::new()
|
.with(
|
||||||
.with_writer(std::io::stderr)
|
tracing_subscriber::fmt::Layer::new()
|
||||||
.with_timer(JiffTimer)
|
.with_writer(std::io::stderr)
|
||||||
.with_thread_names(true)
|
.with_timer(JiffTimer)
|
||||||
.with_filter(filter),
|
.with_thread_names(true),
|
||||||
);
|
)
|
||||||
|
.with(filter);
|
||||||
tracing::subscriber::set_global_default(sub).unwrap();
|
tracing::subscriber::set_global_default(sub).unwrap();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user