Class Logger


  • public final class Logger
    extends java.lang.Object
    Helper to easily log into the application.

    Internal logs can be enabled using setprop log.tag.BatchInternal VERBOSE

    • Field Summary

      Fields 
      Modifier and Type Field Description
      static boolean dev
      Is the logger in dev mode
      static java.lang.String INTERNAL_TAG
      Internal logger tag.
      static LoggerDelegate loggerDelegate
      Logger delegate (optional) The logger delegate is another logger which receives the same logs as this logger
      static java.lang.String PUBLIC_TAG
      Public logger tag.
    • Constructor Summary

      Constructors 
      Constructor Description
      Logger()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static void error​(java.lang.String msg)
      Error log with message.
      static void error​(java.lang.String module, java.lang.String msg)
      Error log with module and message.
      static void error​(java.lang.String module, java.lang.String msg, java.lang.Throwable t)
      Error log with module, message and throwable.
      static void error​(java.lang.String msg, java.lang.Throwable t)
      Error log with message and throwable.
      static void info​(java.lang.String msg)
      Verbose log with message.
      static void info​(java.lang.String module, java.lang.String msg)
      Info log with module and message.
      static void info​(java.lang.String module, java.lang.String msg, java.lang.Throwable t)
      Info log with module, message and throwable.
      static void info​(java.lang.String msg, java.lang.Throwable t)
      Info log with message and throwable.
      static void internal​(java.lang.String msg)
      Debug log with message.
      static void internal​(java.lang.String module, java.lang.String msg)
      Debug log with module and message.
      static void internal​(java.lang.String module, java.lang.String msg, java.lang.Throwable t)
      Debug log with module, message and throwable.
      static void internal​(java.lang.String msg, java.lang.Throwable t)
      Internal log with message and throwable.
      static boolean shouldLogForLevel​(LoggerLevel level)  
      static void verbose​(java.lang.String msg)
      Verbose log with message.
      static void verbose​(java.lang.String module, java.lang.String msg)
      Verbose log with module and message.
      static void verbose​(java.lang.String module, java.lang.String msg, java.lang.Throwable t)
      Verbose log with module, message and throwable.
      static void verbose​(java.lang.String msg, java.lang.Throwable t)
      Verbose log with message and throwable.
      static void warning​(java.lang.String msg)
      Warning log with message.
      static void warning​(java.lang.String module, java.lang.String msg)
      Warning log with module and message.
      static void warning​(java.lang.String module, java.lang.String msg, java.lang.Throwable t)
      Warning log with module, message and throwable.
      static void warning​(java.lang.String msg, java.lang.Throwable t)
      Warning log with message and throwable.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • PUBLIC_TAG

        public static final java.lang.String PUBLIC_TAG
        Public logger tag.
        See Also:
        Constant Field Values
      • INTERNAL_TAG

        public static final java.lang.String INTERNAL_TAG
        Internal logger tag.
        See Also:
        Constant Field Values
      • loggerDelegate

        public static LoggerDelegate loggerDelegate
        Logger delegate (optional) The logger delegate is another logger which receives the same logs as this logger
      • dev

        public static final boolean dev
        Is the logger in dev mode
    • Constructor Detail

      • Logger

        public Logger()
    • Method Detail

      • shouldLogForLevel

        public static boolean shouldLogForLevel​(LoggerLevel level)
      • verbose

        public static void verbose​(java.lang.String module,
                                   java.lang.String msg,
                                   java.lang.Throwable t)
        Verbose log with module, message and throwable.
        Parameters:
        module - Module name.
        msg - Message of the error.
        t - Throwable exception.
      • verbose

        public static void verbose​(java.lang.String msg,
                                   java.lang.Throwable t)
        Verbose log with message and throwable.
        Parameters:
        msg - Message of the error.
        t - Throwable exception.
      • verbose

        public static void verbose​(java.lang.String module,
                                   java.lang.String msg)
        Verbose log with module and message.
        Parameters:
        module - Module name.
        msg - Message of the error.
      • verbose

        public static void verbose​(java.lang.String msg)
        Verbose log with message.
        Parameters:
        msg - Message of the error.
      • info

        public static void info​(java.lang.String module,
                                java.lang.String msg,
                                java.lang.Throwable t)
        Info log with module, message and throwable.
        Parameters:
        module - Module name.
        msg - Message of the error.
        t - Throwable exception.
      • info

        public static void info​(java.lang.String msg,
                                java.lang.Throwable t)
        Info log with message and throwable.
        Parameters:
        msg - Message of the error.
        t - Throwable exception.
      • info

        public static void info​(java.lang.String module,
                                java.lang.String msg)
        Info log with module and message.
        Parameters:
        module - Module name.
        msg - Message of the error.
      • info

        public static void info​(java.lang.String msg)
        Verbose log with message.
        Parameters:
        msg - Message of the error.
      • warning

        public static void warning​(java.lang.String module,
                                   java.lang.String msg,
                                   java.lang.Throwable t)
        Warning log with module, message and throwable.
        Parameters:
        module - Module name.
        msg - Message of the error.
        t - Throwable exception.
      • warning

        public static void warning​(java.lang.String msg,
                                   java.lang.Throwable t)
        Warning log with message and throwable.
        Parameters:
        msg - Message of the error.
        t - Throwable exception.
      • warning

        public static void warning​(java.lang.String module,
                                   java.lang.String msg)
        Warning log with module and message.
        Parameters:
        module - Module name.
        msg - Message of the error.
      • warning

        public static void warning​(java.lang.String msg)
        Warning log with message.
        Parameters:
        msg - Message of the error.
      • error

        public static void error​(java.lang.String module,
                                 java.lang.String msg,
                                 java.lang.Throwable t)
        Error log with module, message and throwable.
        Parameters:
        module - Module name.
        msg - Message of the error.
        t - Throwable exception.
      • error

        public static void error​(java.lang.String msg,
                                 java.lang.Throwable t)
        Error log with message and throwable.
        Parameters:
        msg - Message of the error.
        t - Throwable exception.
      • error

        public static void error​(java.lang.String module,
                                 java.lang.String msg)
        Error log with module and message.
        Parameters:
        module - Module name.
        msg - Message of the error.
      • error

        public static void error​(java.lang.String msg)
        Error log with message.
        Parameters:
        msg - Message of the error.
      • internal

        public static void internal​(java.lang.String module,
                                    java.lang.String msg,
                                    java.lang.Throwable t)
        Debug log with module, message and throwable.
        Parameters:
        module - Module name.
        msg - Message of the error.
        t - Throwable exception.
      • internal

        public static void internal​(java.lang.String msg,
                                    java.lang.Throwable t)
        Internal log with message and throwable.
        Parameters:
        msg - Message of the error.
        t - Throwable exception.
      • internal

        public static void internal​(java.lang.String module,
                                    java.lang.String msg)
        Debug log with module and message.
        Parameters:
        module - Module name.
        msg - Message of the error.
      • internal

        public static void internal​(java.lang.String msg)
        Debug log with message.
        Parameters:
        msg - Message of the error.