Fix: libimagrt: Logging messages to stderr

This commit is contained in:
Matthias Beyer 2016-02-04 18:02:50 +01:00
parent fa5d1553dd
commit fa5738d43a

View file

@ -1,3 +1,6 @@
use std::io::Write;
use std::io::stderr;
use log::{Log, LogLevel, LogRecord, LogMetadata};
pub struct ImagLogger {
@ -23,7 +26,7 @@ impl Log for ImagLogger {
fn log(&self, record: &LogRecord) {
if self.enabled(record.metadata()) {
// TODO: This is just simple logging. Maybe we can enhance this lateron
println!("[imag][{: <5}]: {}", record.level(), record.args());
writeln!(stderr(), "[imag][{: <5}]: {}", record.level(), record.args());
}
}
}