com.resilientedge.util.logger.console
Class ConsoleFormatter

java.lang.Object
  |
  +--com.resilientedge.util.logger.Formatter
        |
        +--com.resilientedge.util.logger.console.ConsoleFormatter
Direct Known Subclasses:
NoTimestampConsoleFormatter

public class ConsoleFormatter
extends Formatter

This class is a System Console implementation of a Formatter.

Author:
odh

Field Summary
protected static java.lang.String DATE_AND_TIME_PATTERN
          Description of the Field
protected  boolean verbose_
          Description of the Field
 
Constructor Summary
ConsoleFormatter()
          Construct a Console Formatter in non-verbose mode.
ConsoleFormatter(boolean verbose)
          Construct a ConsoleFormatter in the supplied verbosity mode.
 
Method Summary
 void format(LogRecord logRecord)
          This method configures the LogRecord with the fully-formatted message to be logged.
protected  void formatClassName(LogRecord logRecord, java.lang.StringBuffer messageBuffer)
          Adds formatted classname information to the supplied StringBuffer.
protected  void formatDateAndTime(LogRecord logRecord, java.lang.StringBuffer messageBuffer)
          Adds formatted Date and Time text to the supplied StringBuffer.
protected  void formatException(LogRecord logRecord, java.lang.StringBuffer messageBuffer)
          Adds formatted exception information to the supplied StringBuffer.
protected  void formatLevel(LogRecord logRecord, java.lang.StringBuffer messageBuffer)
          Adds formatted Level information to the supplied StringBuffer.
protected  void formatMessage(LogRecord logRecord, java.lang.StringBuffer messageBuffer)
          Adds formatted Message text to the supplied StringBuffer.
protected  void formatMethodName(LogRecord logRecord, java.lang.StringBuffer messageBuffer)
          Adds formatted method information to the supplied StringBuffer.
protected  void formatThreadName(LogRecord logRecord, java.lang.StringBuffer messageBuffer)
          Adds formatted thread information to the supplied StringBuffer.
protected  void formatTopic(LogRecord logRecord, java.lang.StringBuffer messageBuffer)
          Adds formatted Topic information to the supplied StringBuffer.
 
Methods inherited from class com.resilientedge.util.logger.Formatter
format, getLocale, setLocale
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

verbose_

protected boolean verbose_
Description of the Field

DATE_AND_TIME_PATTERN

protected static final java.lang.String DATE_AND_TIME_PATTERN
Description of the Field
Constructor Detail

ConsoleFormatter

public ConsoleFormatter()
Construct a Console Formatter in non-verbose mode.

ConsoleFormatter

public ConsoleFormatter(boolean verbose)
Construct a ConsoleFormatter in the supplied verbosity mode. A verbose mode Formatter will format log records with the following additional information:
Parameters:
verbose -  
Method Detail

format

public void format(LogRecord logRecord)
This method configures the LogRecord with the fully-formatted message to be logged.
Overrides:
format in class Formatter
Parameters:
logRecord -  

formatDateAndTime

protected void formatDateAndTime(LogRecord logRecord,
                                 java.lang.StringBuffer messageBuffer)
Adds formatted Date and Time text to the supplied StringBuffer. Format is for the current Locale.
Parameters:
logRecord -  
messageBuffer -  

formatLevel

protected void formatLevel(LogRecord logRecord,
                           java.lang.StringBuffer messageBuffer)
Adds formatted Level information to the supplied StringBuffer. This method only modifies the messageBuffer if the level is known.
Parameters:
logRecord -  
messageBuffer -  

formatTopic

protected void formatTopic(LogRecord logRecord,
                           java.lang.StringBuffer messageBuffer)
Adds formatted Topic information to the supplied StringBuffer.
Parameters:
logRecord -  
messageBuffer -  

formatMessage

protected void formatMessage(LogRecord logRecord,
                             java.lang.StringBuffer messageBuffer)
Adds formatted Message text to the supplied StringBuffer.
Parameters:
logRecord -  
messageBuffer -  

formatClassName

protected void formatClassName(LogRecord logRecord,
                               java.lang.StringBuffer messageBuffer)
Adds formatted classname information to the supplied StringBuffer.
Parameters:
logRecord -  
messageBuffer -  

formatMethodName

protected void formatMethodName(LogRecord logRecord,
                                java.lang.StringBuffer messageBuffer)
Adds formatted method information to the supplied StringBuffer.
Parameters:
logRecord -  
messageBuffer -  

formatThreadName

protected void formatThreadName(LogRecord logRecord,
                                java.lang.StringBuffer messageBuffer)
Adds formatted thread information to the supplied StringBuffer.
Parameters:
logRecord -  
messageBuffer -  

formatException

protected void formatException(LogRecord logRecord,
                               java.lang.StringBuffer messageBuffer)
Adds formatted exception information to the supplied StringBuffer. If the LogRecord does not contain an exception, the StringBuffer is not modified.
Parameters:
logRecord -  
messageBuffer -  


Copyright © 2001 Resilient Edge, Inc. All Rights Reserved.