Skip to content

Commit

Permalink
Allow logger case detection to fail (#316)
Browse files Browse the repository at this point in the history
Signed-off-by: Ana Hobden <[email protected]>
  • Loading branch information
Hoverbear authored and hicqu committed Nov 7, 2019
1 parent d34f693 commit a5e0f13
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -559,14 +559,14 @@ pub fn default_logger() -> slog::Logger {
});
LOGGER.as_ref().unwrap()
};
let case = std::thread::current()
if let Some(case) = std::thread::current()
.name()
.unwrap()
.split(':')
.last()
.unwrap()
.to_string();
logger.new(o!("case" => case))
.and_then(|v| v.split(':').last())
{
logger.new(o!("case" => case.to_string()))
} else {
logger.new(o!())
}
}

type DefaultHashBuilder = std::hash::BuildHasherDefault<fxhash::FxHasher>;
Expand Down

0 comments on commit a5e0f13

Please sign in to comment.