index : static-web-server.git

ascending towards madness

author Tim Small <tim@seoss.co.uk> 2021-05-16 16:51:06.0 +00:00:00
committer Tim Small <tim@seoss.co.uk> 2021-05-30 14:44:52.0 +00:00:00
commit
b91ad87b928c86643c5e1ef124f8cc1818a55c5c [patch]
tree
08e024d7c568a11968b7872d02fea024d092e5a6
parent
cb1bd02e061d7cbd75ac6222ed4eb856d7700f33
download
b91ad87b928c86643c5e1ef124f8cc1818a55c5c.tar.gz

Switch to using stderr for tracing.

Use stderr for logging / tracing, since this is the convention for such
output.

Diff

 src/logger.rs | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/src/logger.rs b/src/logger.rs
index b2b1f75..b2e6271 100644
--- a/src/logger.rs
+++ b/src/logger.rs
@@ -1,3 +1,4 @@
use std::io;
use tracing::Level;
use tracing_subscriber::fmt::format::FmtSpan;

@@ -7,6 +8,7 @@ use crate::Result;
pub fn init(level: &str) -> Result {
    let level = level.parse::<Level>()?;
    match tracing_subscriber::fmt()
        .with_writer(io::stderr)
        .with_max_level(level)
        .with_span_events(FmtSpan::CLOSE)
        .try_init()