-
Notifications
You must be signed in to change notification settings - Fork 36
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Set --release javac option to 8 (#1458)
* Set --release javac option to 8 * replace usage of var
- Loading branch information
1 parent
d6ed31c
commit 73533c8
Showing
2 changed files
with
14 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,28 @@ | ||
package stryker4s.log; | ||
|
||
import java.util.function.Supplier; | ||
import java.util.Map; | ||
|
||
public interface Logger { | ||
|
||
public void log(Level level, Supplier<String> msg); | ||
|
||
public void log(Level level, Supplier<String> msg, Throwable t); | ||
|
||
/** | ||
/** | ||
* Whether colors are enabled in the log | ||
*/ | ||
*/ | ||
public default boolean colorEnabled() { | ||
var env = System.getenv(); | ||
// Explicitly disable color https://no-color.org/ | ||
boolean notNoColor = !env.containsKey("NO_COLOR"); | ||
// If there is a TERM on Linux (or Windows Git Bash), assume we support color | ||
boolean unixEnabled = env.containsKey("TERM"); | ||
// On Windows there's no easy way. But if we're in Windows Terminal or ConEmu, we can assume we support color | ||
boolean windowsEnabled = env.containsKey("WT_SESSION") || (System.getenv().containsKey("ConEmuANSI") && System.getenv("ConEmuANSI").equals("ON")); | ||
Map<String, String> env = System.getenv(); | ||
// Explicitly disable color https://no-color.org/ | ||
boolean notNoColor = !env.containsKey("NO_COLOR"); | ||
// If there is a TERM on Linux (or Windows Git Bash), assume we support color | ||
boolean unixEnabled = env.containsKey("TERM"); | ||
// On Windows there's no easy way. But if we're in Windows Terminal or ConEmu, | ||
// we can assume we support color | ||
boolean windowsEnabled = env.containsKey("WT_SESSION") | ||
|| (System.getenv().containsKey("ConEmuANSI") && System.getenv("ConEmuANSI").equals("ON")); | ||
|
||
return notNoColor && (unixEnabled || windowsEnabled); | ||
return notNoColor && (unixEnabled || windowsEnabled); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters