Class PluginLogger


  • public class PluginLogger
    extends java.lang.Object
    This class is the plugin central log singleton. It supports 4 levels of messages on the contrary of the Java Logger class which contains 5. This class adds the messages to the Eclipse log view.
    • Constructor Summary

      Constructors 
      Constructor Description
      PluginLogger()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static void debug​(java.lang.String pMessage)
      Logs a debug message.
      static void debug​(java.lang.String pMessage, java.lang.Throwable pExc)
      Logs a debug message.
      static void error​(java.lang.String pMessage)
      Logs an error message without cause exception.
      static void error​(java.lang.String pMessage, java.lang.Throwable pExc)
      Logs an error message an optionally the stack trace of the exception which causes the error.
      static void info​(java.lang.String pMessage)
      Logs a information message.
      static boolean isLevel​(LogLevels pLevel)
      Checks whether the logger will return a message of a certain level.
      static void setLevel​(LogLevels pLevel)
      Changes the minimum level of the message printed to the log view.
      static void warning​(java.lang.String pMessage)
      Logs a warning message.
      static void warning​(java.lang.String pMessage, java.lang.Throwable pExc)
      Logs a warning message caused by an exception.
      • Methods inherited from class java.lang.Object

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

      • PluginLogger

        public PluginLogger()
    • Method Detail

      • debug

        public static void debug​(java.lang.String pMessage,
                                 java.lang.Throwable pExc)
        Logs a debug message.
        Parameters:
        pMessage - the message to log
        pExc - the exception causing the message
      • debug

        public static void debug​(java.lang.String pMessage)
        Logs a debug message.
        Parameters:
        pMessage - the message to log
      • info

        public static void info​(java.lang.String pMessage)
        Logs a information message.
        Parameters:
        pMessage - the message to log
      • warning

        public static void warning​(java.lang.String pMessage)
        Logs a warning message.
        Parameters:
        pMessage - the message to log
      • warning

        public static void warning​(java.lang.String pMessage,
                                   java.lang.Throwable pExc)
        Logs a warning message caused by an exception.
        Parameters:
        pMessage - the message to log
        pExc - exception raised. Could be null
      • error

        public static void error​(java.lang.String pMessage,
                                 java.lang.Throwable pExc)
        Logs an error message an optionally the stack trace of the exception which causes the error.
        Parameters:
        pMessage - Message to print in the error log view
        pExc - Exception raised. Could be null.
      • error

        public static void error​(java.lang.String pMessage)
        Logs an error message without cause exception.
        Parameters:
        pMessage - Message to print in the error log view
      • setLevel

        public static void setLevel​(LogLevels pLevel)
        Changes the minimum level of the message printed to the log view.
        Parameters:
        pLevel - the level to set
      • isLevel

        public static boolean isLevel​(LogLevels pLevel)
        Checks whether the logger will return a message of a certain level.
        Parameters:
        pLevel - the level of the message to print
        Returns:
        true if the level is higher or equals to the current log level.