Package org.ssclab.log
Class SscLogger
- java.lang.Object
-
- org.ssclab.log.SscLogger
-
-
Constructor Summary
Constructors Constructor Description SscLogger()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static voidconfig(String message)Logs a configuration message with the log level CONFIG.static voiderror(String message)Logs an error message with a custom log levelSscLevel.ERROR.static voidfine(String message)Logs a detailed message with the log level FINE.static LoggergetLogger()Returns the logger instance used by the application.static voidinfo(String message)Logs an informational message with the log level INFO.static voidlog(String message)Logs a message with a custom log levelSscLevel.LOG.static voidlogFormatted(String message, Object... obj)Logs a formatted message using theString.format(String, Object...)method.static voidnote(String message)Logs a note with a custom log levelSscLevel.NOTE.static voidsetLevel(Level level)Sets the log level for the logger.static voidsetLogToConsole()Sets the logger to output log messages to the console.static voidsetLogToFile(String file_name)Sets the logger to output log messages to a file.static voidsetLogToFile(String file_name, boolean append)Sets the logger to output log messages to a file with an option to append to the file.static voidtime(String message)Logs a timing message with a custom log levelSscLevel.TIME.static voidwarning(String message)Logs a warning message with the log level WARNING.
-
-
-
Method Detail
-
getLogger
public static Logger getLogger()
Returns the logger instance used by the application.- Returns:
- the SSC logger instance
-
log
public static void log(String message)
Logs a message with a custom log levelSscLevel.LOG.- Parameters:
message- the message to be logged
-
error
public static void error(String message)
Logs an error message with a custom log levelSscLevel.ERROR.- Parameters:
message- the error message to be logged
-
info
public static void info(String message)
Logs an informational message with the log level INFO.- Parameters:
message- the info message to be logged
-
fine
public static void fine(String message)
Logs a detailed message with the log level FINE.- Parameters:
message- the fine-grained message to be logged
-
warning
public static void warning(String message)
Logs a warning message with the log level WARNING.- Parameters:
message- the warning message to be logged
-
time
public static void time(String message)
Logs a timing message with a custom log levelSscLevel.TIME.- Parameters:
message- the timing message to be logged
-
config
public static void config(String message)
Logs a configuration message with the log level CONFIG.- Parameters:
message- the configuration message to be logged
-
note
public static void note(String message)
Logs a note with a custom log levelSscLevel.NOTE.- Parameters:
message- the note message to be logged
-
setLevel
public static void setLevel(Level level)
Sets the log level for the logger.- Parameters:
level- the new log level (e.g., INFO, WARNING, SEVERE)
-
logFormatted
public static void logFormatted(String message, Object... obj)
Logs a formatted message using theString.format(String, Object...)method.- Parameters:
message- the format stringobj- the arguments to be used in the format string
-
setLogToFile
public static void setLogToFile(String file_name) throws SecurityException, IOException
Sets the logger to output log messages to a file.- Parameters:
file_name- the name of the log file- Throws:
IOException- if error read fileSecurityException- if error Security
-
setLogToFile
public static void setLogToFile(String file_name, boolean append) throws SecurityException, IOException
Sets the logger to output log messages to a file with an option to append to the file.- Parameters:
file_name- the name of the log fileappend- if true, log messages will be appended to the existing file- Throws:
IOException- if error read fileSecurityException- if error Security
-
setLogToConsole
public static void setLogToConsole()
Sets the logger to output log messages to the console.
-
-