Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
185: move slog implementation into its own module r=kinggoesgaming a=kinggoesgaming **I'm submitting a ...** - [ ] bug fix - [ ] feature enhancement - [ ] deprecation or removal - [x] refactor # Description The slog impl and tests are moved into `slog_support` module # Motivation As part of the refactor effort, feature gated implementations need to be moved into their own modules. # Tests Current provided tests are passing # Related Issue(s) #124
- Loading branch information
Showing
2 changed files
with
34 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
use slog; | ||
use Uuid; | ||
|
||
impl slog::Value for Uuid { | ||
fn serialize( | ||
&self, | ||
_: &slog::Record, | ||
key: slog::Key, | ||
serializer: &mut slog::Serializer, | ||
) -> Result<(), slog::Error> { | ||
serializer.emit_arguments(key, &format_args!("{}", self)) | ||
} | ||
} | ||
|
||
#[cfg(test)] | ||
mod tests { | ||
|
||
#[test] | ||
fn test_slog_kv() { | ||
use slog; | ||
use test_util; | ||
use slog::Drain; | ||
|
||
let root = slog::Logger::root(slog::Discard.fuse(), o!()); | ||
let u1 = test_util::new(); | ||
crit!(root, "test"; "u1" => u1); | ||
} | ||
} |