Skip to content
This repository has been archived by the owner on Nov 6, 2020. It is now read-only.

Place thread name in the log output #1792

Merged
merged 2 commits into from Aug 1, 2016
Merged

Place thread name in the log output #1792

merged 2 commits into from Aug 1, 2016

Conversation

gavofyork
Copy link
Contributor

...But only when more than info.
Closes #1463

...But only when more than info.
Closes #1463
@gavofyork gavofyork added the A0-pleasereview 🤓 Pull request needs code review. label Aug 1, 2016
@coveralls
Copy link

coveralls commented Aug 1, 2016

Coverage Status

Coverage increased (+0.004%) to 86.911% when pulling a98e482 on thread-name-in-log into 4e72608 on master.

@arkpar arkpar added A8-looksgood 🦄 Pull request is reviewed well. and removed A0-pleasereview 🤓 Pull request needs code review. labels Aug 1, 2016
@@ -91,7 +91,8 @@ pub fn setup_log(config: &Config) -> Result<Arc<RotatingLogger>, String> {
let with_color = if max_log_level() <= LogLevelFilter::Info {
format!("{}{}", Colour::Black.bold().paint(timestamp), record.args())
} else {
format!("{}{}:{}: {}", Colour::Black.bold().paint(timestamp), record.level(), record.target(), record.args())
let name = thread::current().name().map(|x| format!("{}", Colour::Blue.bold().paint(x))).unwrap_or_else(Default::default);
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can use map_or_else I think

@coveralls
Copy link

coveralls commented Aug 1, 2016

Coverage Status

Coverage decreased (-0.04%) to 86.868% when pulling 01f7350 on thread-name-in-log into 4e72608 on master.

@gavofyork gavofyork merged commit b26f8c3 into master Aug 1, 2016
@gavofyork gavofyork deleted the thread-name-in-log branch August 1, 2016 17:07
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
A8-looksgood 🦄 Pull request is reviewed well.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants