SmartFrog 3.10.000

org.smartfrog.sfcore.logging
Class LogToNothingImpl

java.lang.Object
  extended by org.smartfrog.sfcore.logging.LogToNothingImpl
All Implemented Interfaces:
Log, LogLevel, LogMessage, LogToNothing
Direct Known Subclasses:
LogToStreamsImpl

public class LogToNothingImpl
extends java.lang.Object
implements LogToNothing, Log, LogMessage, LogLevel

Only out and err output are printed.


Field Summary
protected  ComponentDescription classComponentDescription
          Configuration for class
protected  ComponentDescription componentComponentDescription
          Configuration for component
protected  java.io.PrintStream errstream
          error stream to print to.
protected  boolean errToOut
          Send error output to normal ouput - used to simplify collecting all output
protected  java.lang.String logName
          The name of this simple log instance
protected  java.io.PrintStream outstream
          output stream to print to.
 
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
protected LogToNothingImpl()
          Construct a simple log with given name and log level and log to output level
  LogToNothingImpl(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
  LogToNothingImpl(java.lang.String name, ComponentDescription componentComponentDescription, java.lang.Integer initialLogLevel, java.io.PrintStream out, java.io.PrintStream err)
          Construct a simple log with given name and log level and log to output level
  LogToNothingImpl(java.lang.String name, java.lang.Integer initialLogLevel)
          Construct a simple log with given name and log level and log to output level
  LogToNothingImpl(java.lang.String name, java.lang.Integer initialLogLevel, java.io.PrintStream out, java.io.PrintStream err)
          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 err(java.lang.Object message)
           Log an error with message log level.
 void err(java.lang.Object message, SmartFrogException t)
           Log an error with message log level.
 void err(java.lang.Object message, SmartFrogException t, TerminationRecord tr)
           Log a message with message log level.
 void err(java.lang.Object message, java.lang.Throwable t)
           Log an error with message 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.
 int getLevel()
           Get logging level.
 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 isLevelEnabled(int logLevel)
          Is the given log level currently enabled?
 boolean isTraceEnabled()
           Are trace messages currently enabled?
 boolean isWarnEnabled()
           Are warn messages currently enabled?
 void out(java.lang.Object message)
           Log an error with message log level.
protected  void readSFNothingAttributes(ComponentDescription cd)
          Reads optional and mandatory attributes.
 void setErrstream(java.io.PrintStream errstream)
          set the output stream for logging.
 void setLevel(int currentLogLevel)
           Set logging level.
 void setOutstream(java.io.PrintStream outstream)
          set the output stream for logging.
 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 java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

classComponentDescription

protected ComponentDescription classComponentDescription
Configuration for class


componentComponentDescription

protected ComponentDescription componentComponentDescription
Configuration for component


logName

protected java.lang.String logName
The name of this simple log instance


outstream

protected java.io.PrintStream outstream
output stream to print to. Bonded at construct time, and usually system.err unless otherwise chosen


errstream

protected java.io.PrintStream errstream
error stream to print to. Bonded at construct time, and usually system.err unless otherwise chosen


errToOut

protected boolean errToOut
Send error output to normal ouput - used to simplify collecting all output

Constructor Detail

LogToNothingImpl

protected LogToNothingImpl()
Construct a simple log with given name and log level and log to output level


LogToNothingImpl

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

Parameters:
name - log name
initialLogLevel - level to log at

LogToNothingImpl

public LogToNothingImpl(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

Parameters:
name - log name
componentComponentDescription - A component description to overwrite class configuration
initialLogLevel - level to log at.

LogToNothingImpl

public LogToNothingImpl(java.lang.String name,
                        java.lang.Integer initialLogLevel,
                        java.io.PrintStream out,
                        java.io.PrintStream err)
Construct a simple log with given name and log level and log to output level

Parameters:
name - log name
initialLogLevel - level to log at.
out - output stream to log to
err - error stream to log to

LogToNothingImpl

public LogToNothingImpl(java.lang.String name,
                        ComponentDescription componentComponentDescription,
                        java.lang.Integer initialLogLevel,
                        java.io.PrintStream out,
                        java.io.PrintStream err)
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.
out - output stream to log to
err - error stream to log to
Method Detail

readSFNothingAttributes

protected void readSFNothingAttributes(ComponentDescription cd)
                                throws SmartFrogException
Reads optional and mandatory attributes.

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

setOutstream

public void setOutstream(java.io.PrintStream outstream)
set the output stream for logging. must not be null

Parameters:
outstream - Output stream to set

setErrstream

public void setErrstream(java.io.PrintStream errstream)
set the output stream for logging. must not be null

Parameters:
errstream - Error stream to set

setLevel

public void setLevel(int currentLogLevel)

Set logging level.

Specified by:
setLevel in interface LogLevel
Parameters:
currentLogLevel - new logging level

getLevel

public int getLevel()

Get logging level.

Specified by:
getLevel in interface LogLevel
Returns:
int log level

isLevelEnabled

public boolean isLevelEnabled(int logLevel)
Is the given log level currently enabled?

Specified by:
isLevelEnabled in interface LogLevel
Parameters:
logLevel - is this level enabled?
Returns:
boolean true if given log level is currently enabled

debug

public void debug(java.lang.Object message)

Log a message with debug log level.

Specified by:
debug in interface Log
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
Returns:
boolean true if warn level is currently enabled

out

public void out(java.lang.Object message)

Log an error with message log level.

Same as info messages but without Labels.

Specified by:
out in interface LogMessage
Parameters:
message - log this message

err

public void err(java.lang.Object message)

Log an error with message log level.

Same as info messages but without Labels.

Specified by:
err in interface LogMessage
Parameters:
message - log this message

err

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

Log an error with message log level.

Same as info messages but without Labels.

Specified by:
err in interface LogMessage
Parameters:
message - log this message
t - log this cause

err

public void err(java.lang.Object message,
                SmartFrogException t,
                TerminationRecord tr)

Log a message with message log level.

Same as info messages but without Labels.

Specified by:
err in interface LogMessage
Parameters:
message - log this message
t - log this cause
tr - log this TerminationRecord

err

public void err(java.lang.Object message,
                SmartFrogException t)

Log an error with message log level.

Same as info messages but without Labels.

Specified by:
err in interface LogMessage
Parameters:
message - log this message
t - log this cause

SmartFrog CORE 3.10.000

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