de.opsdesign.yax.log
Class Logger

java.lang.Object
  extended by de.opsdesign.yax.log.Logger
All Implemented Interfaces:
LogListener
Direct Known Subclasses:
AntLogger, ConsoleLogger, Log4jLogger

public abstract class Logger
extends java.lang.Object
implements LogListener

The basic Logger implements console output as default output for the log methods.

Use ConsoleLogger if you only needs log to the console.


Constructor Summary
Logger()
           
 
Method Summary
 java.lang.String getLogMessage(YaxEvent yaxEvent)
          Builds the message string from all information of a yaxEvent
 java.lang.String getSeverityLabel(int msgServerity)
          Maps the severity code to the right label
 boolean isAntLogger()
          Returns true, if implementing class logs for the ant task YaxTask.
 void log(java.lang.String message)
          Notifies all loggers (LogListeners) to log an INFO message.
 void log(java.lang.String message, int severity)
          Notifies all loggers (LogListeners) to log a message with a particular severity.
 void log(YaxEvent yaxEvent)
          Notifies all loggers (LogListeners) to log an elaborated message (for exceptions et al).
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Logger

public Logger()
Method Detail

log

public void log(java.lang.String message)
Description copied from interface: LogListener
Notifies all loggers (LogListeners) to log an INFO message. This signature is for normal INFO messages. (The severity will be set to the default INFO).

Specified by:
log in interface LogListener
Parameters:
message - message to log

log

public void log(java.lang.String message,
                int severity)
Description copied from interface: LogListener
Notifies all loggers (LogListeners) to log a message with a particular severity. This signature is deditated for messages with a severity other than INFO.

Specified by:
log in interface LogListener
Parameters:
message - message to log
severity - log severity(Log.ERROR,-WARN,-INFO,-VERBOSE or -DEBUG)

log

public void log(YaxEvent yaxEvent)
Description copied from interface: LogListener
Notifies all loggers (LogListeners) to log an elaborated message (for exceptions et al). This signature is deditated especially for exceptions and events with elaborated log requirements.

Specified by:
log in interface LogListener
Parameters:
yaxEvent - consist of all relevant event information (also complete information about message exception)

getLogMessage

public java.lang.String getLogMessage(YaxEvent yaxEvent)
Description copied from interface: LogListener
Builds the message string from all information of a yaxEvent

Specified by:
getLogMessage in interface LogListener
Parameters:
yaxEvent - consist of all relevant event information (also complete information about message exception)
Returns:
message ready to use to log output

getSeverityLabel

public java.lang.String getSeverityLabel(int msgServerity)
Description copied from interface: LogListener
Maps the severity code to the right label

Specified by:
getSeverityLabel in interface LogListener
Parameters:
msgServerity - log severity(Log.ERROR,-WARN,-INFO,-VERBOSE or -DEBUG)
Returns:
label string that corresponds with the severity code

isAntLogger

public boolean isAntLogger()
Description copied from interface: LogListener
Returns true, if implementing class logs for the ant task YaxTask.

When yax runs in Ant-mode, all yax will be redirected to ant.

Specified by:
isAntLogger in interface LogListener
Returns:
true, if the implementing class is an AntLogger, otherwise false.


Copyright © 2008 OPS Design GmbH. All Rights Reserved.