mirror of
https://github.com/nushell/nushell
synced 2024-12-26 13:03:07 +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);
|
||||
|
||||
// Only TermLogger supports color output
|
||||
if !matches!(log_target, LogTarget::File) {
|
||||
set_colored_level(builder, level);
|
||||
if matches!(
|
||||
log_target,
|
||||
LogTarget::Stdout | LogTarget::Stderr | LogTarget::Mixed
|
||||
) {
|
||||
Level::iter().for_each(|level| set_colored_level(builder, level));
|
||||
}
|
||||
|
||||
(level.to_level_filter(), log_target)
|
||||
|
|
Loading…
Reference in a new issue