Class SanitizedLogger

    • Constructor Summary

      Constructors 
      Constructor Description
      SanitizedLogger​(LogSpi logger)
      Implementation of LogSpi that sanitizes log messages before delegating to the configured logger.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean isLoggable​(java.lang.Class<?> clazz, Log.Level level)
      Determines if the it should be logged based on Class and Level.
      void log​(java.lang.Class<?> clazz, java.lang.StackTraceElement caller, Log.Level level, java.lang.String message, java.lang.Throwable ex)
      Sanitize control characters from log messages before delegating to the configured LogSpi class.
      void log​(java.lang.Class<?> clazz, java.lang.String method, Log.Level level, java.lang.String message, java.lang.Throwable ex)
      Sanitize control characters from log messages before delegating to the configured LogSpi class.
      boolean needToInferCaller​(java.lang.Class<?> clazz, Log.Level level)
      Determines if Log need to infer caller based on Class and Level.
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • SanitizedLogger

        public SanitizedLogger​(LogSpi logger)
        Implementation of LogSpi that sanitizes log messages before delegating to the configured logger.
    • Method Detail

      • log

        public void log​(java.lang.Class<?> clazz,
                        java.lang.String method,
                        Log.Level level,
                        java.lang.String message,
                        java.lang.Throwable ex)
        Sanitize control characters from log messages before delegating to the configured LogSpi class.
        Specified by:
        log in interface LogSpi
        Parameters:
        clazz - Class that logging.
        level - the level at which to log.
        message - optional message to send to the log.
        ex - optional exception at logging point.
      • log

        public void log​(java.lang.Class<?> clazz,
                        java.lang.StackTraceElement caller,
                        Log.Level level,
                        java.lang.String message,
                        java.lang.Throwable ex)
        Sanitize control characters from log messages before delegating to the configured LogSpi class.
        Specified by:
        log in interface LogSpi
        Parameters:
        clazz - Class that logging.
        level - the level at which to log.
        message - optional message to send to the log.
        ex - optional exception at logging point.
      • isLoggable

        public boolean isLoggable​(java.lang.Class<?> clazz,
                                  Log.Level level)
        Description copied from interface: LogSpi
        Determines if the it should be logged based on Class and Level.
        Specified by:
        isLoggable in interface LogSpi
      • needToInferCaller

        public boolean needToInferCaller​(java.lang.Class<?> clazz,
                                         Log.Level level)
        Description copied from interface: LogSpi
        Determines if Log need to infer caller based on Class and Level.
        Specified by:
        needToInferCaller in interface LogSpi