Replace log with tracing

Tracing is a modern replacement for the log crate that allows for
annotating log messages with the function that they come from.

Signed-off-by: John Nunley <dev@notgull.net>
Closes: #3482
This commit is contained in:
John Nunley 2024-02-25 19:20:39 -08:00 committed by Kirill Chibisov
parent 96172693fe
commit 944347696a
44 changed files with 249 additions and 68 deletions

View file

@ -18,7 +18,7 @@ use calloop::generic::Generic;
use calloop::EventLoop as Loop;
use calloop::{ping::Ping, Readiness};
use libc::{setlocale, LC_CTYPE};
use log::warn;
use tracing::warn;
use x11rb::connection::RequestConnection;
use x11rb::errors::{ConnectError, ConnectionError, IdsExhausted, ReplyError};
@ -483,7 +483,7 @@ impl<T: 'static> EventLoop<T> {
.dispatch(timeout, &mut self.state)
.map_err(std::io::Error::from)
{
log::error!("Failed to poll for events: {error:?}");
tracing::error!("Failed to poll for events: {error:?}");
let exit_code = error.raw_os_error().unwrap_or(1);
self.set_exit_code(exit_code);
return;
@ -567,7 +567,7 @@ impl<T: 'static> EventLoop<T> {
callback(event, &self.event_processor.target)
}
Some(Err(e)) => {
log::error!("Failed to get activation token: {}", e);
tracing::error!("Failed to get activation token: {}", e);
}
None => {}
}