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