Class POILogger

  • Direct Known Subclasses:
    CommonsLogger, NullLogger, SystemOutLogger

    @Internal
    public abstract class POILogger
    extends java.lang.Object
    A logger interface that strives to make it as easy as possible for developers to write log calls, while simultaneously making those calls as cheap as possible by performing lazy evaluation of the log message.

    • Field Summary

      Fields 
      Modifier and Type Field Description
      static int DEBUG  
      static int ERROR  
      static int FATAL  
      static int INFO  
      static int WARN  
    • Method Summary

      All Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and Type Method Description
      abstract boolean check​(int level)
      Check if a logger is enabled to log at the specified level This allows code to avoid building strings or evaluating functions in the arguments to log.
      abstract void initialize​(java.lang.String cat)  
      void log​(int level, java.lang.Object... objs)
      Log a message.
      • Methods inherited from class java.lang.Object

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

      • initialize

        public abstract void initialize​(java.lang.String cat)
      • check

        public abstract boolean check​(int level)
        Check if a logger is enabled to log at the specified level This allows code to avoid building strings or evaluating functions in the arguments to log. An example:
         if (logger.check(POILogger.INFO)) {
             logger.log(POILogger.INFO, "Avoid concatenating " + " strings and evaluating " + functions());
         }
         
        Parameters:
        level - One of DEBUG, INFO, WARN, ERROR, FATAL
      • log

        public void log​(int level,
                        java.lang.Object... objs)
        Log a message. Lazily appends Object parameters together. If the last parameter is a Throwable it is logged specially.
        Parameters:
        level - One of DEBUG, INFO, WARN, ERROR, FATAL
        objs - the objects to place in the message