Class Logger

    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      static Logger getInstance​(java.lang.Class clazz)  
      static LogProvider getLogProvider()  
      static boolean isAtLeastLogLevel​(LogLevel level)
      Check if the log level passed in parameter is not greater then the log level set by the application.
      void logD​(java.lang.String methodName, java.lang.String pattern, java.lang.Object... args)
      Log a debug message
      void logE​(java.lang.String methodName, java.lang.String pattern, java.lang.Object... args)
      Log an error message
      void logI​(java.lang.String methodName, java.lang.String pattern, java.lang.Object... args)
      Log an informational message
      void logStack​(java.lang.String methodName, java.lang.String pattern, java.lang.Object... args)
      Log an error message with a stack trace.
      void logV​(java.lang.String methodName, java.lang.String pattern, java.lang.Object... args)
      Log a verbose message
      void logW​(java.lang.String methodName, java.lang.String pattern, java.lang.Object... args)
      Log a warning message
      void onLogMessage​(java.lang.String msg, LogLevel level, java.lang.String tag)
      Called for each log message from the media engine.
      static void setLogProvider​(LogProvider logProvider)  
      • Methods inherited from class java.lang.Object

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

      • DEFAULT_STRINGBUILDER_CAPACITY

        public static final int DEFAULT_STRINGBUILDER_CAPACITY
        See Also:
        Constant Field Values
      • SYSTEM_LINE_SEPARATOR

        public static final java.lang.String SYSTEM_LINE_SEPARATOR
    • Method Detail

      • getInstance

        public static Logger getInstance​(java.lang.Class clazz)
      • setLogProvider

        public static void setLogProvider​(LogProvider logProvider)
      • getLogProvider

        public static LogProvider getLogProvider()
      • onLogMessage

        public void onLogMessage​(java.lang.String msg,
                                 LogLevel level,
                                 java.lang.String tag)
        Called for each log message from the media engine.
        Specified by:
        onLogMessage in interface LogProvider
        Parameters:
        msg - The log message.
        level - The log level associated with the message.
        tag - The tag associated with the message. Null by default.
      • isAtLeastLogLevel

        public static boolean isAtLeastLogLevel​(LogLevel level)
        Check if the log level passed in parameter is not greater then the log level set by the application.
        Parameters:
        level - The log level associated with the message.
        Returns:
        returns "true" if the log level passed in parameter is not greater then the log level set by the application, otherwise "false".
      • logStack

        public void logStack​(java.lang.String methodName,
                             java.lang.String pattern,
                             java.lang.Object... args)
        Log an error message with a stack trace.
        Parameters:
        methodName - name of the method the log is called from.
        pattern - The log message pattern string.
        args - The values to be formatted. If exception is needed to be passed, pass it as the last argument in list.
      • logE

        public void logE​(java.lang.String methodName,
                         java.lang.String pattern,
                         java.lang.Object... args)
        Log an error message
        Parameters:
        methodName - name of the method the log is called from.
        pattern - The log message pattern string.
        args - The values to be formatted. If exception is needed to be passed, pass it as the last argument in list.
      • logD

        public void logD​(java.lang.String methodName,
                         java.lang.String pattern,
                         java.lang.Object... args)
        Log a debug message
        Parameters:
        methodName - name of the method the log is called from.
        pattern - The log message pattern string.
        args - The values to be formatted.
      • logW

        public void logW​(java.lang.String methodName,
                         java.lang.String pattern,
                         java.lang.Object... args)
        Log a warning message
        Parameters:
        methodName - name of the method the log is called from.
        pattern - The log message pattern string.
        args - The values to be formatted.
      • logI

        public void logI​(java.lang.String methodName,
                         java.lang.String pattern,
                         java.lang.Object... args)
        Log an informational message
        Parameters:
        methodName - name of the method the log is called from.
        pattern - The log message pattern string.
        args - The values to be formatted.
      • logV

        public void logV​(java.lang.String methodName,
                         java.lang.String pattern,
                         java.lang.Object... args)
        Log a verbose message
        Parameters:
        methodName - name of the method the log is called from.
        pattern - The log message pattern string.
        args - The values to be formatted.