

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 |
NetBeans implementation of Log that uses the default ErrorManager. The following system properties are supported to configure the behavior of this logger:
LOG_LEVEL_PROPERTY - Default logging detail level for all instances of NetBeansLog. Must be one of ("trace", "debug", "info", "warn", "error", or "fatal"). If not specified, defaults to LOG_LEVEL_DEFAULT. SHOW_LOG_NAME_PROPERTY - Set to true if you want the Log instance name to be included in output messages. Defaults to SHOW_LOG_NAME_DEFAULT SHOW_SHORT_LOG_NAME_PROPERTY - Set to true if you want the last component of the name to be included in output messages. Defaults to SHOW_SHORT_LOG_NAME_DEFAULT. SHOW_DATE_TIME_PROPERTY - Set to true if you want the current date and time to be included in output messages. Default is SHOW_DATE_TIME_DEFAULT. SYSTEM_PREFIX.log.xxxxx - Logging detail level for a NetBeansLog instance named "xxxxx". Must be one of ("trace", "debug", "info", "warn", "error", or "fatal"). If not specified, the default logging detail level is used. 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).
| cern::gp::logging::NetBeansLog::NetBeansLog | ( | String | name | ) | [inline] |
Construct a simple log with given name.
| name | log name |
References LOG_LEVEL_PROPERTY, logName, nblogProps, setLevel(), and SYSTEM_PREFIX.
| cern::gp::logging::NetBeansLog::[static initializer] | ( | ) | [inline, static, package] |
| String cern::gp::logging::NetBeansLog::createLogMessage | ( | int | type, | |
| Object | message | |||
| ) | [inline, protected] |
References dateFormatter, logName, prefix, showDateTime, showLogName, and showShortName.
Referenced by log().
| void cern::gp::logging::NetBeansLog::debug | ( | Object | message, | |
| Throwable | t | |||
| ) | [inline] |
References display(), isLevelEnabled(), log(), and LOG_LEVEL_DEBUG.
| void cern::gp::logging::NetBeansLog::debug | ( | Object | message | ) | [inline] |
| void cern::gp::logging::NetBeansLog::display | ( | int | logLevel, | |
| Object | message, | |||
| Throwable | t | |||
| ) | [inline, protected] |
| void cern::gp::logging::NetBeansLog::error | ( | Object | message, | |
| Throwable | t | |||
| ) | [inline] |
References display(), isLevelEnabled(), log(), and LOG_LEVEL_ERROR.
| void cern::gp::logging::NetBeansLog::error | ( | Object | message | ) | [inline] |
| void cern::gp::logging::NetBeansLog::fatal | ( | Object | message, | |
| Throwable | t | |||
| ) | [inline] |
References display(), isLevelEnabled(), log(), and LOG_LEVEL_FATAL.
| 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] |
References display(), isLevelEnabled(), log(), and LOG_LEVEL_INFO.
| 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?
| 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] |
| void cern::gp::logging::NetBeansLog::setLevel | ( | int | currentLogLevel | ) | [inline] |
| void cern::gp::logging::NetBeansLog::trace | ( | Object | message, | |
| Throwable | t | |||
| ) | [inline] |
References display(), isLevelEnabled(), log(), and LOG_LEVEL_TRACE.
| void cern::gp::logging::NetBeansLog::trace | ( | Object | message | ) | [inline] |
| void cern::gp::logging::NetBeansLog::warn | ( | Object | message, | |
| Throwable | t | |||
| ) | [inline] |
References display(), isLevelEnabled(), log(), and LOG_LEVEL_WARN.
| void cern::gp::logging::NetBeansLog::warn | ( | Object | message | ) | [inline] |
int cern::gp::logging::NetBeansLog::currentLogLevel [protected] |
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] |
final String cern::gp::logging::NetBeansLog::DATE_FORMAT_PROPERTY = SYSTEM_PREFIX + ".DateFormat" [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().
final int cern::gp::logging::NetBeansLog::LOG_LEVEL_ALL = (LOG_LEVEL_TRACE - 1) [static] |
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().
final int cern::gp::logging::NetBeansLog::LOG_LEVEL_OFF = (LOG_LEVEL_FATAL + 1) [static] |
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 boolean cern::gp::logging::NetBeansLog::SHOW_DATE_TIME_DEFAULT = false [static] |
final String cern::gp::logging::NetBeansLog::SHOW_DATE_TIME_PROPERTY = SYSTEM_PREFIX + ".ShowDateTime" [static] |
final boolean cern::gp::logging::NetBeansLog::SHOW_LOG_NAME_DEFAULT = false [static] |
final String cern::gp::logging::NetBeansLog::SHOW_LOG_NAME_PROPERTY = SYSTEM_PREFIX + ".ShowLogName" [static] |
final boolean cern::gp::logging::NetBeansLog::SHOW_SHORT_LOG_NAME_DEFAULT = true [static] |
final String cern::gp::logging::NetBeansLog::SHOW_SHORT_LOG_NAME_PROPERTY = SYSTEM_PREFIX + ".ShowShortLogName" [static] |
boolean cern::gp::logging::NetBeansLog::showDateTime = SHOW_DATE_TIME_DEFAULT [static, protected] |
Referenced by createLogMessage().
boolean cern::gp::logging::NetBeansLog::showLogName = SHOW_LOG_NAME_DEFAULT [static, protected] |
Referenced by createLogMessage().
boolean cern::gp::logging::NetBeansLog::showShortName = SHOW_SHORT_LOG_NAME_DEFAULT [static, protected] |
Referenced by createLogMessage().
final String cern::gp::logging::NetBeansLog::SYSTEM_PREFIX = "cern.gp.logging" [static] |
Referenced by NetBeansLog().
1.6.2