log to stderr, not stdout

This commit is contained in:
Scott Lamb 2023-08-03 15:48:19 -05:00
parent b9db9c11cc
commit 0f019b6fb3
2 changed files with 7 additions and 0 deletions

View File

@ -11,6 +11,10 @@ upgrades, e.g. `0.6.x` -> `0.7.x`. The config file format and
[API](ref/api.md) currently have no stability guarantees, so they may change
even on minor releases, e.g. `0.7.5` -> `0.7.6`.
## unreleased
* log to `stderr` again, fixing a regression with the `tracing` change in 0.7.6.
## 0.7.6 (2023-07-08)
* new log formats using `tracing`. This will allow richer context information.

View File

@ -118,6 +118,7 @@ pub fn install() {
Ok(s) if s == "systemd" => {
let sub = tracing_subscriber::registry().with(
tracing_subscriber::fmt::Layer::new()
.with_writer(std::io::stderr)
.with_ansi(false)
.event_format(FormatSystemd)
.with_filter(filter),
@ -127,6 +128,7 @@ pub fn install() {
Ok(s) if s == "json" => {
let sub = tracing_subscriber::registry().with(
tracing_subscriber::fmt::Layer::new()
.with_writer(std::io::stderr)
.with_thread_names(true)
.json()
.with_filter(filter),
@ -136,6 +138,7 @@ pub fn install() {
_ => {
let sub = tracing_subscriber::registry().with(
tracing_subscriber::fmt::Layer::new()
.with_writer(std::io::stderr)
.with_timer(ChronoTimer)
.with_thread_names(true)
.with_filter(filter),