Package helma.util

Class Logger

java.lang.Object
helma.util.Logger
All Implemented Interfaces:
org.apache.commons.logging.Log
Direct Known Subclasses:
FileLogger

public class Logger extends Object implements org.apache.commons.logging.Log
A simple logger that writes to a PrintStream such as System.out.
  • Field Details

  • Constructor Details

    • Logger

      protected Logger(PrintStream out)
      Create a logger for a PrintStream, such as System.out.
      Parameters:
      out - the output stream
  • Method Details

    • getLogLevel

      public int getLogLevel()
      Get the current log level.
      Returns:
      the current log level
    • setLogLevel

      public void setLogLevel(int logLevel)
      Set the log level for this logger.
      Parameters:
      logLevel - the new log level
    • toString

      public String toString()
      Return a string representation of this Logger
      Overrides:
      toString in class Object
    • getCanonicalName

      public String getCanonicalName()
      Return an object which identifies this logger.
      Returns:
      the canonical name of this logger
    • log

      protected void log(String level, Object msg, Throwable exception)
      Append a message to the log.
      Parameters:
      level - a string representing the log level
      msg - the log message
      exception - an exception, or null
    • write

      protected void write()
      This is called by the runner thread to perform actual output.
    • ensureOpen

      protected void ensureOpen()
      This is called by the runner thread to to make sure we have an open writer.
    • renderDate

      protected static void renderDate()
    • isTraceEnabled

      public boolean isTraceEnabled()
      Specified by:
      isTraceEnabled in interface org.apache.commons.logging.Log
    • isDebugEnabled

      public boolean isDebugEnabled()
      Specified by:
      isDebugEnabled in interface org.apache.commons.logging.Log
    • isInfoEnabled

      public boolean isInfoEnabled()
      Specified by:
      isInfoEnabled in interface org.apache.commons.logging.Log
    • isWarnEnabled

      public boolean isWarnEnabled()
      Specified by:
      isWarnEnabled in interface org.apache.commons.logging.Log
    • isErrorEnabled

      public boolean isErrorEnabled()
      Specified by:
      isErrorEnabled in interface org.apache.commons.logging.Log
    • isFatalEnabled

      public boolean isFatalEnabled()
      Specified by:
      isFatalEnabled in interface org.apache.commons.logging.Log
    • trace

      public void trace(Object parm1)
      Specified by:
      trace in interface org.apache.commons.logging.Log
    • trace

      public void trace(Object parm1, Throwable parm2)
      Specified by:
      trace in interface org.apache.commons.logging.Log
    • debug

      public void debug(Object parm1)
      Specified by:
      debug in interface org.apache.commons.logging.Log
    • debug

      public void debug(Object parm1, Throwable parm2)
      Specified by:
      debug in interface org.apache.commons.logging.Log
    • info

      public void info(Object parm1)
      Specified by:
      info in interface org.apache.commons.logging.Log
    • info

      public void info(Object parm1, Throwable parm2)
      Specified by:
      info in interface org.apache.commons.logging.Log
    • warn

      public void warn(Object parm1)
      Specified by:
      warn in interface org.apache.commons.logging.Log
    • warn

      public void warn(Object parm1, Throwable parm2)
      Specified by:
      warn in interface org.apache.commons.logging.Log
    • error

      public void error(Object parm1)
      Specified by:
      error in interface org.apache.commons.logging.Log
    • error

      public void error(Object parm1, Throwable parm2)
      Specified by:
      error in interface org.apache.commons.logging.Log
    • fatal

      public void fatal(Object parm1)
      Specified by:
      fatal in interface org.apache.commons.logging.Log
    • fatal

      public void fatal(Object parm1, Throwable parm2)
      Specified by:
      fatal in interface org.apache.commons.logging.Log
    • getStackTrace

      public static String getStackTrace(Throwable t)
    • getSedatedLog

      protected org.apache.commons.logging.Log getSedatedLog()
      return a "quiet" version of this log that routes debug() output to trace()
      Returns:
      a possibly less verbose version of this log.