cern::gp::logging::NetBeansLog Class Reference

Inheritance diagram for cern::gp::logging::NetBeansLog:
Inheritance graph
[legend]
Collaboration diagram for cern::gp::logging::NetBeansLog:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 NetBeansLog (String name)
void setLevel (int currentLogLevel)
int getLevel ()
boolean isTraceEnabled ()
boolean isDebugEnabled ()
boolean isInfoEnabled ()
boolean isWarnEnabled ()
boolean isErrorEnabled ()
boolean isFatalEnabled ()
void trace (Object message)
void trace (Object message, Throwable t)
void debug (Object message)
void debug (Object message, Throwable t)
void info (Object message)
void info (Object message, Throwable t)
void warn (Object message)
void warn (Object message, Throwable t)
void error (Object message)
void error (Object message, Throwable t)
void fatal (Object message)
void fatal (Object message, Throwable t)

Static Public Attributes

static final String SYSTEM_PREFIX = "cern.gp.logging"
static final String LOG_LEVEL_PROPERTY = SYSTEM_PREFIX + ".DefaultLevel"
static final String SHOW_LOG_NAME_PROPERTY = SYSTEM_PREFIX + ".ShowLogName"
static final String SHOW_SHORT_LOG_NAME_PROPERTY = SYSTEM_PREFIX + ".ShowShortLogName"
static final String SHOW_DATE_TIME_PROPERTY = SYSTEM_PREFIX + ".ShowDateTime"
static final String DATE_FORMAT_PROPERTY = SYSTEM_PREFIX + ".DateFormat"
static final String DATE_FORMAT_DEFAULT = "yyyy/MM/dd HH:mm:ss:SSS zzz"
static final String LOG_LEVEL_DEFAULT = "info"
static final boolean SHOW_LOG_NAME_DEFAULT = false
static final boolean SHOW_SHORT_LOG_NAME_DEFAULT = true
static final boolean SHOW_DATE_TIME_DEFAULT = false
static final int LOG_LEVEL_TRACE = ErrorManager.INFORMATIONAL
static final int LOG_LEVEL_DEBUG = ErrorManager.INFORMATIONAL + 1
static final int LOG_LEVEL_INFO = ErrorManager.USER
static final int LOG_LEVEL_WARN = ErrorManager.WARNING
static final int LOG_LEVEL_ERROR = ErrorManager.EXCEPTION
static final int LOG_LEVEL_FATAL = ErrorManager.ERROR
static final int LOG_LEVEL_ALL = (LOG_LEVEL_TRACE - 1)
static final int LOG_LEVEL_OFF = (LOG_LEVEL_FATAL + 1)

Protected Member Functions

void display (int logLevel, Object message, Throwable t)
void log (int type, Object msg, Throwable t)
String createLogMessage (int type, Object message)
boolean isLevelEnabled (int logLevel)

Protected Attributes

String logName = null
int currentLogLevel

Static Protected Attributes

static final ErrorManager errMgr = ErrorManager.getDefault()
static final Properties nblogProps = new Properties()
static boolean showLogName = SHOW_LOG_NAME_DEFAULT
static boolean showShortName = SHOW_SHORT_LOG_NAME_DEFAULT
static boolean showDateTime = SHOW_DATE_TIME_DEFAULT
static DateFormat dateFormatter = null

Static Package Functions

 [static initializer]

Private Attributes

String prefix = null

Detailed Description

NetBeans implementation of Log that uses the default ErrorManager. The following system properties are supported to configure the behavior of this logger:

In addition to looking for system properties with the names specified above, this implementation also checks for a class loader resource named LOG_PROPERTIES, and includes any matching definitions from this resource (if it exists).

Author:
Katarina Sigerud
Version:
Id
NetBeansLog.java,v 1.3 2006/09/25 08:52:36 acaproni Exp

Constructor & Destructor Documentation

cern::gp::logging::NetBeansLog::NetBeansLog ( String  name  )  [inline]

Construct a simple log with given name.

Parameters:
name log name

References LOG_LEVEL_PROPERTY, logName, nblogProps, setLevel(), and SYSTEM_PREFIX.


Member Function Documentation

cern::gp::logging::NetBeansLog::[static initializer] (  )  [inline, static, package]
String cern::gp::logging::NetBeansLog::createLogMessage ( int  type,
Object  message 
) [inline, protected]
void cern::gp::logging::NetBeansLog::debug ( Object  message,
Throwable  t 
) [inline]
void cern::gp::logging::NetBeansLog::debug ( Object  message  )  [inline]
void cern::gp::logging::NetBeansLog::display ( int  logLevel,
Object  message,
Throwable  t 
) [inline, protected]

Referenced by debug(), error(), fatal(), info(), trace(), and warn().

void cern::gp::logging::NetBeansLog::error ( Object  message,
Throwable  t 
) [inline]
void cern::gp::logging::NetBeansLog::error ( Object  message  )  [inline]
void cern::gp::logging::NetBeansLog::fatal ( Object  message,
Throwable  t 
) [inline]
void cern::gp::logging::NetBeansLog::fatal ( Object  message  )  [inline]
int cern::gp::logging::NetBeansLog::getLevel (  )  [inline]

Get logging level.

References currentLogLevel.

void cern::gp::logging::NetBeansLog::info ( Object  message,
Throwable  t 
) [inline]
void cern::gp::logging::NetBeansLog::info ( Object  message  )  [inline]
boolean cern::gp::logging::NetBeansLog::isDebugEnabled (  )  [inline]

References isLevelEnabled().

boolean cern::gp::logging::NetBeansLog::isErrorEnabled (  )  [inline]

References isLevelEnabled().

boolean cern::gp::logging::NetBeansLog::isFatalEnabled (  )  [inline]

References isLevelEnabled().

boolean cern::gp::logging::NetBeansLog::isInfoEnabled (  )  [inline]

References isLevelEnabled().

boolean cern::gp::logging::NetBeansLog::isLevelEnabled ( int  logLevel  )  [inline, protected]

Is the given log level currently enabled?

Parameters:
logLevel is this level enabled?

References currentLogLevel.

Referenced by debug(), error(), fatal(), info(), isDebugEnabled(), isErrorEnabled(), isFatalEnabled(), isInfoEnabled(), isTraceEnabled(), isWarnEnabled(), trace(), and warn().

boolean cern::gp::logging::NetBeansLog::isTraceEnabled (  )  [inline]

References isLevelEnabled().

boolean cern::gp::logging::NetBeansLog::isWarnEnabled (  )  [inline]

References isLevelEnabled().

void cern::gp::logging::NetBeansLog::log ( int  type,
Object  msg,
Throwable  t 
) [inline, protected]

Do the actual logging. This method assembles the message and then logs using the default ErrorManager.

References createLogMessage(), and errMgr.

Referenced by debug(), error(), fatal(), info(), trace(), and warn().

void cern::gp::logging::NetBeansLog::setLevel ( int  currentLogLevel  )  [inline]

Set logging level.

Parameters:
level new logging level

Referenced by NetBeansLog().

void cern::gp::logging::NetBeansLog::trace ( Object  message,
Throwable  t 
) [inline]
void cern::gp::logging::NetBeansLog::trace ( Object  message  )  [inline]
void cern::gp::logging::NetBeansLog::warn ( Object  message,
Throwable  t 
) [inline]
void cern::gp::logging::NetBeansLog::warn ( Object  message  )  [inline]

Member Data Documentation

The current log level

Referenced by getLevel(), and isLevelEnabled().

final String cern::gp::logging::NetBeansLog::DATE_FORMAT_DEFAULT = "yyyy/MM/dd HH:mm:ss:SSS zzz" [static]
DateFormat cern::gp::logging::NetBeansLog::dateFormatter = null [static, protected]

Referenced by createLogMessage().

final ErrorManager cern::gp::logging::NetBeansLog::errMgr = ErrorManager.getDefault() [static, protected]

Referenced by log().

Enable all logging levels

final int cern::gp::logging::NetBeansLog::LOG_LEVEL_DEBUG = ErrorManager.INFORMATIONAL + 1 [static]

"Finer" level logging (ErrorManager.INFORMATIONAL + 1)

Referenced by debug().

final String cern::gp::logging::NetBeansLog::LOG_LEVEL_DEFAULT = "info" [static]
final int cern::gp::logging::NetBeansLog::LOG_LEVEL_ERROR = ErrorManager.EXCEPTION [static]

"Warning" level logging = ErrorManager.EXCEPTION

Referenced by error().

final int cern::gp::logging::NetBeansLog::LOG_LEVEL_FATAL = ErrorManager.ERROR [static]

"Severe" level logging = ErrorManager.ERROR

Referenced by fatal().

final int cern::gp::logging::NetBeansLog::LOG_LEVEL_INFO = ErrorManager.USER [static]

"Config" level logging (ErrorManager.WARNING).

Referenced by info().

Disable all logging levels

final String cern::gp::logging::NetBeansLog::LOG_LEVEL_PROPERTY = SYSTEM_PREFIX + ".DefaultLevel" [static]

Referenced by NetBeansLog().

final int cern::gp::logging::NetBeansLog::LOG_LEVEL_TRACE = ErrorManager.INFORMATIONAL [static]

"Finest" level logging (Debug window).

Referenced by trace().

final int cern::gp::logging::NetBeansLog::LOG_LEVEL_WARN = ErrorManager.WARNING [static]

"Info" level logging (ErrorManager.USER)

Referenced by warn().

String cern::gp::logging::NetBeansLog::logName = null [protected]

The name of this simple log instance

Referenced by createLogMessage(), and NetBeansLog().

final Properties cern::gp::logging::NetBeansLog::nblogProps = new Properties() [static, protected]

Referenced by NetBeansLog().

String cern::gp::logging::NetBeansLog::prefix = null [private]

Referenced by createLogMessage().

final String cern::gp::logging::NetBeansLog::SHOW_SHORT_LOG_NAME_PROPERTY = SYSTEM_PREFIX + ".ShowShortLogName" [static]

Referenced by createLogMessage().

Referenced by createLogMessage().

Referenced by createLogMessage().

final String cern::gp::logging::NetBeansLog::SYSTEM_PREFIX = "cern.gp.logging" [static]

Referenced by NetBeansLog().


The documentation for this class was generated from the following file:

Generated by  doxygen 1.6.2