|
|
@@ -44,6 +44,7 @@ pub fn nanos(t: DateTime<Utc>) -> u64 { |
|
|
|
(t.timestamp() as u64) * 1_000_000_000_u64 + (t.timestamp_subsec_nanos() as u64) |
|
|
|
} |
|
|
|
|
|
|
|
#[cfg(not(test))] |
|
|
|
pub fn file_logger(path: &str, level: Severity) -> slog::Logger { |
|
|
|
let mut builder = FileLoggerBuilder::new(path); |
|
|
|
builder.level(level); |
|
|
@@ -51,6 +52,13 @@ pub fn file_logger(path: &str, level: Severity) -> slog::Logger { |
|
|
|
builder.build().unwrap() |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
#[cfg(test)] |
|
|
|
pub fn file_logger(path: &str, level: Severity) -> slog::Logger { |
|
|
|
use slog::*; |
|
|
|
Logger::root(Discard, o!()) |
|
|
|
} |
|
|
|
|
|
|
|
pub fn dt_nanos(t: DateTime<Utc>) -> i64 { |
|
|
|
(t.timestamp() as i64) * 1_000_000_000_i64 + (t.timestamp_subsec_nanos() as i64) |
|
|
|
} |
|
|
|