mirror of
https://github.com/Team4388/2022NoWayHome.git
synced 2026-06-09 08:48:07 -06:00
Switch to disable logging with the off level
This commit is contained in:
@@ -563,7 +563,7 @@ public class DriverStation {
|
||||
boolean printTrace,
|
||||
StackTraceElement[] stackTrace,
|
||||
int stackTraceFirst) {
|
||||
if (frc4388.utility.AnsiLogging.ENABLED) {
|
||||
if (frc4388.utility.AnsiLogging.LEVEL.equals(java.util.logging.Level.OFF)) {
|
||||
java.util.logging.LogRecord logRecord = new java.util.logging.LogRecord(isError ? java.util.logging.Level.SEVERE : java.util.logging.Level.FINER, error.stripTrailing());
|
||||
logRecord.setLoggerName("HAL");
|
||||
if (!frc4388.utility.AnsiLogging.halLoggerHandler.isLoggable(logRecord)) return;
|
||||
|
||||
@@ -29,14 +29,12 @@ import org.fusesource.jansi.AnsiConsole;
|
||||
import org.fusesource.jansi.AnsiPrintStream;
|
||||
|
||||
public class AnsiLogging {
|
||||
public static final boolean ENABLED = true;
|
||||
public static final Level LEVEL = Level.ALL;
|
||||
private static final AnsiPrintStream ANSI_CONSOLE_STREAM = AnsiConsole.err();
|
||||
private static final Level LEVEL = Level.ALL;
|
||||
|
||||
public static Handler halLoggerHandler = new ConsoleHandler();
|
||||
|
||||
public static void systemInstall() {
|
||||
if (!ENABLED) return;
|
||||
if (LEVEL.equals(Level.OFF)) return;
|
||||
try {
|
||||
// Configure java.util.logging.Logger to output additional colored information.
|
||||
LogManager.getLogManager().updateConfiguration(key -> (o, n) -> {
|
||||
|
||||
Reference in New Issue
Block a user