Class LogManager

java.lang.Object
weka.knowledgeflow.LogManager
All Implemented Interfaces:
LogHandler

public class LogManager extends Object implements LogHandler
Class that wraps a weka.gui.Logger and filters log messages according to the set logging level. Note that warnings and errors reported via the logWarning() and logError() methods will always be output regardless of the logging level set.
Version:
$Revision: $
Author:
Mark Hall (mhall{[at]}pentaho{[dot]}com)
  • Constructor Details

    • LogManager

      public LogManager(Step source)
      Constructor that takes a Step. Uses the log from the step
      Parameters:
      source - the source Step
    • LogManager

      public LogManager(Logger log)
      Constructor that takes a log
      Parameters:
      log - the log to wrap
    • LogManager

      public LogManager(Logger log, boolean status)
      Constructor that takes a log
      Parameters:
      log - the log to wrap
      status - true if warning and error messages should be output to the status area as well as to the log
  • Method Details

    • stackTraceToString

      public static String stackTraceToString(Throwable throwable)
      Utility method to convert a stack trace to a String
      Parameters:
      throwable - the Throwable to convert to a stack trace string
      Returns:
      the string containing the stack trace
    • setLog

      public void setLog(Logger log)
      Set the log wrap
      Specified by:
      setLog in interface LogHandler
      Parameters:
      log - the log to wrap
    • getLog

      public Logger getLog()
      Get the wrapped log
      Specified by:
      getLog in interface LogHandler
      Returns:
      the wrapped log
    • getLoggingLevel

      public LoggingLevel getLoggingLevel()
      Get the logging level in use
      Returns:
    • setLoggingLevel

      public void setLoggingLevel(LoggingLevel level)
      Set the logging level to use
      Parameters:
      level - the level to use
    • logLow

      public void logLow(String message)
      Log at the low level
      Parameters:
      message - the message to log
    • logBasic

      public void logBasic(String message)
      Log at the basic level
      Parameters:
      message - the message to log
    • logDetailed

      public void logDetailed(String message)
      Log at the detailed level
      Parameters:
      message - the message to log
    • logDebug

      public void logDebug(String message)
      Log at the debugging level
      Parameters:
      message - the message to log
    • logWarning

      public void logWarning(String message)
      Log a warning
      Parameters:
      message - the message to log
    • logError

      public void logError(String message, Exception cause)
      Log an error
      Parameters:
      message - the message to log
      cause - the cause of the error
    • statusMessage

      public void statusMessage(String message)
      Output a status message
      Parameters:
      message - the status message
    • log

      public void log(String message, LoggingLevel messageLevel)
      Log a message at the supplied level
      Parameters:
      message - the message to log
      messageLevel - the level to log at