Package fr.sandro642.github.log
Class Logger
java.lang.Object
fr.sandro642.github.log.Logger
Logger is a utility class for logging messages in the ConnectLib library.
It provides methods to log messages with different severity levels:
INFO, WARN, ERROR, and CRITICAL.
Use setShowLogs(true/false) to control console output.
Logs are always saved to file regardless of the setting.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidMethod to display a critical message in the console.voidMethod to display an error message in the console.voidMethod to display an informational message in the console.voidshowLogs()Enable console output for logs.voidMethod to display a warning message in the console.
-
Constructor Details
-
Logger
public Logger()
-
-
Method Details
-
showLogs
public void showLogs()Enable console output for logs. Call this method once to display all logs in console. By default, logs are only saved to file without console output. Logs are always saved to file regardless of this setting. -
INFO
Method to display an informational message in the console. This method prints the message in green color if showLogs is enabled, and always logs it to file.- Parameters:
msg- The message to log
-
WARN
Method to display a warning message in the console. This method prints the message in yellow color if showLogs is enabled, and always logs it to file.- Parameters:
msg- The message to log
-
ERROR
Method to display an error message in the console. This method prints the message in red color if showLogs is enabled, and always logs it to file.- Parameters:
msg- The message to log
-
CRITICAL
Method to display a critical message in the console. This method prints the message in magenta color if showLogs is enabled, and always logs it to file.- Parameters:
msg- The message to log
-