Class SscLogger


  • public class SscLogger
    extends Object
    The SscLogger class is a custom logging utility for the SSC application. It provides a simplified interface to log messages with different levels of severity to either the console or a file. It also supports custom log levels defined in SscLevel.
    • Constructor Detail

      • SscLogger

        public SscLogger()
    • 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 level SscLevel.LOG.
        Parameters:
        message - the message to be logged
      • error

        public static void error​(String message)
        Logs an error message with a custom log level SscLevel.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 level SscLevel.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 level SscLevel.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 the String.format(String, Object...) method.
        Parameters:
        message - the format string
        obj - the arguments to be used in the format string
      • 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 file
        append - if true, log messages will be appended to the existing file
        Throws:
        IOException - if error read file
        SecurityException - if error Security
      • setLogToConsole

        public static void setLogToConsole()
        Sets the logger to output log messages to the console.