mirror of
https://github.com/saymrwulf/xous-core.git
synced 2026-11-16 08:38:26 +00:00
discard errors on log write
this at least removes a panic that crashes processes. it does mean that some log messages can get silently lost, but this is better than crashing if the arguments to the logger can't be parsed for some reason?
This commit is contained in:
parent
7a724a15cf
commit
5fa8f2a6a3
1 changed files with 4 additions and 1 deletions
|
|
@ -69,7 +69,10 @@ impl XousLoggerBacking<'_> {
|
|||
}
|
||||
|
||||
let mut wrapper = cursor::BufferWrapper::new(&mut log_record.args);
|
||||
write!(wrapper, "{}", record.args()).unwrap();
|
||||
match write!(wrapper, "{}", record.args()) {
|
||||
Ok(_) => {},
|
||||
Err(_e) => {}, // if there's an error on the write, just silently discard it...
|
||||
}
|
||||
log_record.args_length = wrapper.len() as u32;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue