mirror of
https://gitlab.com/fabinfra/fabaccess/sute.git
synced 2025-03-12 14:41:52 +01:00
Logging
This commit is contained in:
parent
3e7127f3df
commit
925460bd40
@ -26,7 +26,7 @@ smol = "1.2"
|
||||
|
||||
signal-hook = "0.1"
|
||||
|
||||
slog = "2.5"
|
||||
slog = { version = "2.5", features = ["max_level_trace"] }
|
||||
|
||||
libc = "0.2"
|
||||
rsasl = "0.2.3"
|
||||
|
@ -69,6 +69,7 @@ impl<'a, S: Unpin> Sute<'a, S> {
|
||||
}
|
||||
|
||||
fn handle_resize(&mut self, new_size: (u16,u16)) {
|
||||
trace!(self.log, "Locking in handle_resize");
|
||||
self.state.lock_mut().size = new_size;
|
||||
}
|
||||
|
||||
@ -82,6 +83,7 @@ impl<'a, S: Unpin> Sute<'a, S> {
|
||||
}
|
||||
|
||||
pub fn handle_key(&mut self, key: Key) {
|
||||
trace!(self.log, "Locking in handle_key");
|
||||
let mut state = self.state.lock_mut();
|
||||
match key {
|
||||
Key::Char('\n') => {
|
||||
@ -96,7 +98,8 @@ impl<'a, S: Unpin> Sute<'a, S> {
|
||||
Key::Backspace => {
|
||||
state.cmd_line.pop();
|
||||
},
|
||||
_ => {}
|
||||
_ => {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -118,6 +121,7 @@ impl <'a, S: Unpin + Signal<Item=(u16,u16)>> Future for Sute<'a, S> {
|
||||
},
|
||||
// If the input closes stop the program
|
||||
None => {
|
||||
trace!(self.log, "Locking in impl Future for Sute");
|
||||
self.state.lock_mut().running = false;
|
||||
return Poll::Ready(());
|
||||
},
|
||||
|
@ -116,6 +116,13 @@ fn main() -> Result<(), io::Error> {
|
||||
Ok(())
|
||||
};
|
||||
|
||||
crit!(log, "Critical log line");
|
||||
error!(log, "Error log line");
|
||||
warn!(log, "Warning log line");
|
||||
info!(log, "Informational log line");
|
||||
debug!(log, "Debugging log line");
|
||||
trace!(log, "Tracing log line");
|
||||
|
||||
lex.spawn(rpc_future).detach();
|
||||
let t: Task<Result<(), io::Error>> = lex.spawn(ui_future);
|
||||
t.detach();
|
||||
|
Loading…
x
Reference in New Issue
Block a user