Class PluginLogger


  • public class PluginLogger
    extends Object
    A simple logger that prefixes each message with the plug-in name.
    Author:
    Ulli Hafner
    • Constructor Detail

      • PluginLogger

        public PluginLogger​(PrintStream logger,
                            String pluginName)
        Creates a new instance of PluginLogger.
        Parameters:
        logger - the actual print stream to log to
        pluginName - the plug-in name
      • PluginLogger

        protected PluginLogger​(String pluginName)
        Creates a new instance of PluginLogger. Note that the logger needs to be set afterwards to avoid throwing a NullPointerException.
        Parameters:
        pluginName - the plug-in name
    • Method Detail

      • setLogger

        protected void setLogger​(PrintStream logger)
        Sets the logger to the specified value.
        Parameters:
        logger - the value to set
      • log

        public void log​(String message)
        Logs the specified message.
        Parameters:
        message - the message
      • log

        public void log​(Throwable throwable)
        Logs the specified throwable.
        Parameters:
        throwable - the throwable
      • printStackTrace

        public void printStackTrace​(Throwable throwable)
        Logs the stack trace of the throwable.
        Parameters:
        throwable - the throwable
      • logLines

        public void logLines​(String lines)
        Logs several lines that already contain a prefix.
        Parameters:
        lines - the lines to log