Skip to content

Commit f56480a

Browse files
committed
Merge branch 'rotation' of github.com:AliceLanniste/wickdb into rotation
2 parents 9a0e1c1 + 56110d8 commit f56480a

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

src/logger.rs

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ use crate::db::filename::{generate_filename, FileType};
1515
use crate::error::Result;
1616
use crate::storage::{File, Storage};
1717

18+
1819
use log::{LevelFilter, Log, Metadata, Record};
1920
use slog::{o, Drain, Level};
2021

@@ -75,6 +76,8 @@ impl Logger {
7576
};
7677
Self { inner, level }
7778
}
79+
80+
7881
}
7982

8083
impl Log for Logger {
@@ -116,6 +119,7 @@ impl Log for Logger {
116119
}
117120
}
118121
fn flush(&self) {}
122+
119123
}
120124

121125
fn log_to_slog_level(level: log::Level) -> Level {
@@ -146,8 +150,10 @@ impl<F: File> FileBasedDrain<F> {
146150
rotators: vec![],
147151
new_file: Box::new(new_file),
148152
}
153+
149154
}
150155

156+
151157
fn add_rotator<R: 'static + Rotator>(mut self, rotator: R) -> Self {
152158
if rotator.is_enabled() {
153159
self.rotators.push(Box::new(rotator));
@@ -254,8 +260,15 @@ impl Rotator for RotatedFileBySize {
254260
*self.file_size.lock().unwrap() = 0;
255261
Ok(())
256262
}
263+
264+
257265
}
258266

267+
268+
269+
270+
271+
259272
#[cfg(test)]
260273
mod tests {
261274

0 commit comments

Comments
 (0)