|
|
@ -21,19 +21,19 @@ pub trait Logger { |
|
|
|
where
|
|
|
|
Self: Sized,
|
|
|
|
{
|
|
|
|
self.writeln(3, msg)
|
|
|
|
self.writeln(3, msg);
|
|
|
|
}
|
|
|
|
fn debug<S: AsRef<str> + Into<String>>(&self, msg: S)
|
|
|
|
where
|
|
|
|
Self: Sized,
|
|
|
|
{
|
|
|
|
self.writeln(4, msg)
|
|
|
|
self.writeln(4, msg);
|
|
|
|
}
|
|
|
|
fn trace<S: AsRef<str> + Into<String>>(&self, msg: S)
|
|
|
|
where
|
|
|
|
Self: Sized,
|
|
|
|
{
|
|
|
|
self.writeln(5, msg)
|
|
|
|
self.writeln(5, msg);
|
|
|
|
}
|
|
|
|
fn put<S: AsRef<str> + Into<String>>(&self, entries: impl IntoIterator<Item = Entry<S>>) -> usize |
|
|
|
where
|
|
|
@ -88,12 +88,12 @@ impl<'a, L> FilteringLogger<'a, L> { |
|
|
|
impl<'a, L: Logger> Logger for FilteringLogger<'a, L> {
|
|
|
|
fn write<S: AsRef<str> + Into<String>>(&self, level: Level, str: S) {
|
|
|
|
if level <= self.max_level {
|
|
|
|
self.logger.write(level, str)
|
|
|
|
self.logger.write(level, str);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
fn writeln<S: AsRef<str> + Into<String>>(&self, level: Level, str: S) {
|
|
|
|
if level <= self.max_level {
|
|
|
|
self.logger.writeln(level, str)
|
|
|
|
self.logger.writeln(level, str);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|