SmartFrog 3.10.000

org.smartfrog.sfcore.logging
Class LogToPrimImpl

java.lang.Object
  extended by org.smartfrog.sfcore.logging.LogToNothingImpl
      extended by org.smartfrog.sfcore.logging.LogToStreamsImpl
          extended by org.smartfrog.sfcore.logging.LogToPrimImpl
All Implemented Interfaces:
Log, LogLevel, LogMessage, LogToNothing, LogToPrim, LogToStreams

public class LogToPrimImpl
extends LogToStreamsImpl
implements LogToPrim

Logs log info into a Prim that implements Log interface


Field Summary
 
Fields inherited from class org.smartfrog.sfcore.logging.LogToStreamsImpl
callDepth, currentLogLevel, dateFormatter, ERROR_NAMES, logName, showDateTime, showLogName, showMethodCall, showShortName, showStackTrace, showThreadName
 
Fields inherited from class org.smartfrog.sfcore.logging.LogToNothingImpl
classComponentDescription, componentComponentDescription, errstream, errToOut, outstream
 
Fields inherited from interface org.smartfrog.sfcore.logging.LogToPrim
ATR_DEBUG, ATR_LOG_TO, ATR_TAG_MESSAGE
 
Fields inherited from interface org.smartfrog.sfcore.logging.LogToStreams
ATR_DATE_FORMAT, ATR_SHOW_DATE_TIME, ATR_SHOW_LOG_NAME, ATR_SHOW_METHOD_CALL, ATR_SHOW_SHORT_NAME, ATR_SHOW_STACK_TRACE, ATR_SHOW_THREAD_NAME
 
Fields inherited from interface org.smartfrog.sfcore.logging.LogToNothing
ATR_ERR_TO_OUT
 
Fields inherited from interface org.smartfrog.sfcore.logging.LogLevel
LOG_LEVEL_ALL, LOG_LEVEL_DEBUG, LOG_LEVEL_ERROR, LOG_LEVEL_FATAL, LOG_LEVEL_IGNORE, LOG_LEVEL_INFO, LOG_LEVEL_OFF, LOG_LEVEL_TRACE, LOG_LEVEL_WARN
 
Constructor Summary
LogToPrimImpl(java.lang.String name, ComponentDescription componentComponentDescription, java.lang.Integer initialLogLevel)
          Construct a simple log with given name and log level and log to output level
LogToPrimImpl(java.lang.String name, java.lang.Integer initialLogLevel)
          Construct a simple log with given name and log level and log to output level
 
Method Summary
 void debug(java.lang.Object message)
           Log a message with debug log level.
 void debug(java.lang.Object message, java.lang.Throwable t)
           Log an error with debug log level.
 void error(java.lang.Object message)
           Log a message with error log level.
 void error(java.lang.Object message, java.lang.Throwable t)
           Log an error with error log level.
 void fatal(java.lang.Object message)
           Log a message with fatal log level.
 void fatal(java.lang.Object message, java.lang.Throwable t)
           Log an error with fatal log level.
 LogRemote getLogTo()
          Get the destination log
 void info(java.lang.Object message)
           Log a message with info log level.
 void info(java.lang.Object message, java.lang.Throwable t)
           Log an error with info log level.
 boolean isDebugEnabled()
           Are debug messages currently enabled?
 boolean isErrorEnabled()
           Are error messages currently enabled?
 boolean isFatalEnabled()
           Are fatal messages currently enabled?
 boolean isInfoEnabled()
           Are info messages currently enabled?
 boolean isTraceEnabled()
           Are trace messages currently enabled?
 boolean isWarnEnabled()
           Are warn messages currently enabled?
protected  void readSFPrimAttributes(ComponentDescription cd)
          Reads optional and mandatory attributes.
 void setLogTo(LogRemote logTo)
          Set the destination log
 void trace(java.lang.Object message)
           Log a message with trace log level.
 void trace(java.lang.Object message, java.lang.Throwable t)
           Log an error with trace log level.
 void warn(java.lang.Object message)
           Log a message with warn log level.
 void warn(java.lang.Object message, java.lang.Throwable t)
           Log an error with warn log level.
 
Methods inherited from class org.smartfrog.sfcore.logging.LogToStreamsImpl
getLevel, isLevelEnabled, log, logToText, readSFStreamsAttributes, setErrstream, setLevel, setOutstream, write
 
Methods inherited from class org.smartfrog.sfcore.logging.LogToNothingImpl
err, err, err, err, out, readSFNothingAttributes
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.smartfrog.sfcore.logging.LogMessage
err, err, err, err, out
 

Constructor Detail

LogToPrimImpl

public LogToPrimImpl(java.lang.String name,
                     java.lang.Integer initialLogLevel)
              throws SmartFrogException
Construct a simple log with given name and log level and log to output level

Parameters:
name - log name
initialLogLevel - level to log at
Throws:
SmartFrogException - if failed to construct the log

LogToPrimImpl

public LogToPrimImpl(java.lang.String name,
                     ComponentDescription componentComponentDescription,
                     java.lang.Integer initialLogLevel)
              throws SmartFrogException
Construct a simple log with given name and log level and log to output level

Parameters:
name - log name
componentComponentDescription - A component description to overwrite class configuration
initialLogLevel - level to log at
Throws:
SmartFrogException - if failed to construct the log
Method Detail

getLogTo

public LogRemote getLogTo()
Get the destination log

Specified by:
getLogTo in interface LogToPrim
Returns:
the destination for logging messages.

setLogTo

public void setLogTo(LogRemote logTo)
Set the destination log

Parameters:
logTo - destination log to set

readSFPrimAttributes

protected void readSFPrimAttributes(ComponentDescription cd)
                             throws SmartFrogResolutionException
Reads optional and mandatory attributes.

Parameters:
cd - cd ComponentDescription A component description to read attributes from
Throws:
SmartFrogResolutionException - error while reading attributes

debug

public void debug(java.lang.Object message)

Log a message with debug log level.

Specified by:
debug in interface Log
Overrides:
debug in class LogToStreamsImpl
Parameters:
message - log this message

debug

public void debug(java.lang.Object message,
                  java.lang.Throwable t)

Log an error with debug log level.

Specified by:
debug in interface Log
Overrides:
debug in class LogToStreamsImpl
Parameters:
message - log this message
t - log this cause

trace

public void trace(java.lang.Object message)

Log a message with trace log level.

Specified by:
trace in interface Log
Overrides:
trace in class LogToStreamsImpl
Parameters:
message - log this message

trace

public void trace(java.lang.Object message,
                  java.lang.Throwable t)

Log an error with trace log level.

Specified by:
trace in interface Log
Overrides:
trace in class LogToStreamsImpl
Parameters:
message - log this message
t - log this cause

info

public void info(java.lang.Object message)

Log a message with info log level.

Specified by:
info in interface Log
Overrides:
info in class LogToStreamsImpl
Parameters:
message - log this message

info

public void info(java.lang.Object message,
                 java.lang.Throwable t)

Log an error with info log level.

Specified by:
info in interface Log
Overrides:
info in class LogToStreamsImpl
Parameters:
message - log this message
t - log this cause

warn

public void warn(java.lang.Object message)

Log a message with warn log level.

Specified by:
warn in interface Log
Overrides:
warn in class LogToStreamsImpl
Parameters:
message - log this message

warn

public void warn(java.lang.Object message,
                 java.lang.Throwable t)

Log an error with warn log level.

Specified by:
warn in interface Log
Overrides:
warn in class LogToStreamsImpl
Parameters:
message - log this message
t - log this cause

error

public void error(java.lang.Object message)

Log a message with error log level.

Specified by:
error in interface Log
Overrides:
error in class LogToStreamsImpl
Parameters:
message - log this message

error

public void error(java.lang.Object message,
                  java.lang.Throwable t)

Log an error with error log level.

Specified by:
error in interface Log
Overrides:
error in class LogToStreamsImpl
Parameters:
message - log this message
t - log this cause

fatal

public void fatal(java.lang.Object message)

Log a message with fatal log level.

Specified by:
fatal in interface Log
Overrides:
fatal in class LogToStreamsImpl
Parameters:
message - log this message

fatal

public void fatal(java.lang.Object message,
                  java.lang.Throwable t)

Log an error with fatal log level.

Specified by:
fatal in interface Log
Overrides:
fatal in class LogToStreamsImpl
Parameters:
message - log this message
t - log this cause

isDebugEnabled

public boolean isDebugEnabled()

Are debug messages currently enabled?

This allows expensive operations such as String concatenation to be avoided when the message will be ignored by the logger.

Specified by:
isDebugEnabled in interface Log
Overrides:
isDebugEnabled in class LogToStreamsImpl
Returns:
boolean true if debug level is currently enabled

isErrorEnabled

public boolean isErrorEnabled()

Are error messages currently enabled?

This allows expensive operations such as String concatenation to be avoided when the message will be ignored by the logger.

Specified by:
isErrorEnabled in interface Log
Overrides:
isErrorEnabled in class LogToStreamsImpl
Returns:
boolean true if error level is currently enabled

isFatalEnabled

public boolean isFatalEnabled()

Are fatal messages currently enabled?

This allows expensive operations such as String concatenation to be avoided when the message will be ignored by the logger.

Specified by:
isFatalEnabled in interface Log
Overrides:
isFatalEnabled in class LogToStreamsImpl
Returns:
boolean true if fatal level is currently enabled

isInfoEnabled

public boolean isInfoEnabled()

Are info messages currently enabled?

This allows expensive operations such as String concatenation to be avoided when the message will be ignored by the logger.

Specified by:
isInfoEnabled in interface Log
Overrides:
isInfoEnabled in class LogToStreamsImpl
Returns:
boolean true if info level is currently enabled

isTraceEnabled

public boolean isTraceEnabled()

Are trace messages currently enabled?

This allows expensive operations such as String concatenation to be avoided when the message will be ignored by the logger.

Specified by:
isTraceEnabled in interface Log
Overrides:
isTraceEnabled in class LogToStreamsImpl
Returns:
boolean true if trace level is currently enabled

isWarnEnabled

public boolean isWarnEnabled()

Are warn messages currently enabled?

This allows expensive operations such as String concatenation to be avoided when the message will be ignored by the logger.

Specified by:
isWarnEnabled in interface Log
Overrides:
isWarnEnabled in class LogToStreamsImpl
Returns:
boolean true if warn level is currently enabled

SmartFrog CORE 3.10.000

(C) Copyright 1998-2006 Hewlett-Packard Development Company, LP