Package frc.team670.robot.utils
Class Logger
java.lang.Object
frc.team670.robot.utils.Logger
public class Logger
extends java.lang.Object
Implements a logging system for the robot. Code taken from
http://stemrobotics.cs.pdx.edu/node/7150
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
Logger.CustomLogger
Configures and holds (static) classes for our custom logging system. -
Field Summary
Fields Modifier and Type Field Description static java.io.PrintStream
LOG_PRINT_STREAM
Open print stream that writes to the log file.static java.util.logging.Logger
LOGGER
Logging class for use by other classes to log though this custom logging scheme. -
Method Summary
Modifier and Type Method Description static void
consoleLog()
Write blank line with program location to the console log.static void
consoleLog(java.lang.String message, java.lang.Object... parameters)
Write message to console log with optional formatting and program location.static java.lang.String
currentMethod()
Returns program location where call to this method is located.static void
logException(java.lang.Throwable e)
Write exception message to DS console window and exception stack trace to log file.
-
Field Details
-
LOG_PRINT_STREAM
public static final java.io.PrintStream LOG_PRINT_STREAMOpen print stream that writes to the log file. Example of use: exception.printStackTrace(Util.logPrintStream); -
LOGGER
public static final java.util.logging.Logger LOGGERLogging class for use by other classes to log though this custom logging scheme. All logging should be done by calls to methods on this class instance or with the convenience methods of the Logging class.
-
-
Method Details
-
currentMethod
public static java.lang.String currentMethod()Returns program location where call to this method is located. -
consoleLog
public static void consoleLog(java.lang.String message, java.lang.Object... parameters)Write message to console log with optional formatting and program location.- Parameters:
message
- Message with optional format specifiers for listed parameters. Use '%s' for formatting. It makes the parameters appear in the String where the '%s' are in order of input.parameters
- Parameter list matching format specifiers.
-
consoleLog
public static void consoleLog()Write blank line with program location to the console log. -
logException
public static void logException(java.lang.Throwable e)Write exception message to DS console window and exception stack trace to log file.- Parameters:
e
- The exception to log.
-