Class DefaultLoggerFormatter

    • Constructor Detail

      • DefaultLoggerFormatter

        public DefaultLoggerFormatter()
    • Method Detail

      • format

        public String format​(Level logLevel,
                             String message,
                             Throwable throwable)
        Description copied from interface: LoggerFormatter
        Formats the inputs into a string that will be printed.
        Specified by:
        format in interface LoggerFormatter
        logLevel - the log level.
        message - the message.
        throwable - the throwable, which can be null.
        the formatted string that will be printed onto the console.
      • timestamp

        protected String timestamp()
        Returns a timestamp to be included in the default output log format.
        a timestamp or date format, might be null or empty.
      • logLevel

        protected String logLevel​(Level level)
        Converts the log level enum to its string representation.

        Note that in the default implementation, the aim is to preserve the length of the log levels so some levels are prefixed with whitespace - this is not a typo.

        level - the level to convert.
        the converted level.