Package glair.vision.logger
Class Logger
java.lang.Object
glair.vision.logger.Logger
A simple logger class for logging messages with various log levels and a
customizable log pattern.
-
Method Summary
Modifier and TypeMethodDescriptionvoidLog a debug message.voidLog an error message.static LoggerGet the singleton instance of the logger.Get the current log level.Get the log pattern.voidLog an info message.static voidMain method for testing the logger.voidsetLogLevel(int logLevel) Set the log level.voidsetPattern(String pattern) Set the log pattern.toString()Get a string representation of the logger configuration.voidLog a warning message.
-
Method Details
-
getInstance
Get the singleton instance of the logger.- Returns:
- The logger instance.
-
getLogLevel
Get the current log level.- Returns:
- The log level as a string.
-
setLogLevel
public void setLogLevel(int logLevel) Set the log level.- Parameters:
logLevel- The log level to set. Possible values:
-LoggerConfig.DEBUGfor debugging messages.
-LoggerConfig.INFOfor informational messages.
-LoggerConfig.WARNfor warning messages.
-LoggerConfig.ERRORfor error messages.
-
getPattern
Get the log pattern.- Returns:
- The log pattern.
-
setPattern
Set the log pattern.- Parameters:
pattern- The log pattern to set.
-
debug
Log a debug message.- Parameters:
args- The objects to log.
-
info
Log an info message.- Parameters:
args- The objects to log.
-
warn
Log a warning message.- Parameters:
args- The objects to log.
-
error
Log an error message.- Parameters:
args- The objects to log.
-
toString
Get a string representation of the logger configuration. -
main
Main method for testing the logger.- Parameters:
args- Command-line arguments (not used).
-