Skip to content

Commit

Permalink
Don't use color when writing to file
Browse files Browse the repository at this point in the history
[ci skip-build-wheels]
  • Loading branch information
gshuflin committed Aug 25, 2020
1 parent 40d6b13 commit 853783d
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/rust/engine/logging/src/logger.rs
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,11 @@ impl Log for PantsLogger {
);

let level = record.level();
let use_color = self.use_color.load(Ordering::SeqCst);
let destination_is_file = match destination {
Destination::Pantsd => true,
Destination::Stderr => false,
};
let use_color = self.use_color.load(Ordering::SeqCst) && (!destination_is_file);

let level_marker = match level {
_ if !use_color => format!("[{}]", level).normal().clear(),
Expand Down

0 comments on commit 853783d

Please sign in to comment.