Class EASyLoggerFactory


  • public class EASyLoggerFactory
    extends java.lang.Object
    Factory for the current logger. The current logger is encapsulated in EASyLogger to provide simple access. For an example of the usage of this class see the containing package.
    Author:
    Sass
    • Field Detail

      • DEBUG

        public static final boolean DEBUG
        This constant value should be set to:
        • false: For a release.
        • true: For development.
        See Also:
        Constant Field Values
      • LOGGING_LEVEL_PROPERTY

        private static final java.lang.String LOGGING_LEVEL_PROPERTY
        See Also:
        Constant Field Values
      • LOG_FILE_PATH

        private static final java.lang.String LOG_FILE_PATH
        Specification to log into a specified file instead of logging into the console.
        See Also:
        Constant Field Values
    • Constructor Detail

      • EASyLoggerFactory

        private EASyLoggerFactory()
        Singleton constructor for Logger.
    • Method Detail

      • getLogger

        public EASyLoggerFactory.EASyLogger getLogger​(java.lang.Class<?> clazz,
                                                      java.lang.String bundleName)
        Returns a logger instance for logging informations, warnings, and errors in a concrete class. This logger instance should not be passed to other classes.
        Parameters:
        clazz - The class to log.
        bundleName - The name of the plug-in containing the logged class (can be null).
        Returns:
        ILogger A logger instance for this specified class and plug-in.
      • setLogger

        public ILogger setLogger​(ILogger logger)
        Sets an ILogger. This ILogger will be used inside the getLogger(Class, String) method for creating concrete logger instances. Also all already created loggers will be updated automatically.
        Parameters:
        logger - The new ILogger which shall be used to log all info, warnings, and errors. Must not be null.
        Returns:
        the active logger before this operation
      • getLoggingLevel

        public LoggingLevel getLoggingLevel()
        Returns the LoggingLevel that is used by the logger.
        Returns:
        The logging level that is set.