mirror of
https://github.com/nushell/nushell
synced 2024-12-27 05:23:11 +00:00
Fix color settings for logger (#6285)
Signed-off-by: nibon7 <nibon7@163.com>
This commit is contained in:
parent
271fda7c91
commit
c74254c2cb
1 changed files with 5 additions and 2 deletions
|
@ -97,8 +97,11 @@ pub fn configure(
|
||||||
let log_target = LogTarget::from(target);
|
let log_target = LogTarget::from(target);
|
||||||
|
|
||||||
// Only TermLogger supports color output
|
// Only TermLogger supports color output
|
||||||
if !matches!(log_target, LogTarget::File) {
|
if matches!(
|
||||||
set_colored_level(builder, level);
|
log_target,
|
||||||
|
LogTarget::Stdout | LogTarget::Stderr | LogTarget::Mixed
|
||||||
|
) {
|
||||||
|
Level::iter().for_each(|level| set_colored_level(builder, level));
|
||||||
}
|
}
|
||||||
|
|
||||||
(level.to_level_filter(), log_target)
|
(level.to_level_filter(), log_target)
|
||||||
|
|
Loading…
Reference in a new issue