public abstract class Logger
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static class |
Logger.Category
An enumeration of different categories for log messages.
|
Constructor and Description |
---|
Logger() |
Modifier and Type | Method and Description |
---|---|
void |
debug(Logger.Category category,
java.lang.String msg)
Log a message with debug level.
|
void |
debug(Logger.Category category,
java.lang.String msg,
java.lang.Throwable t)
Log a message with debug level, with associated Throwable information.
|
void |
debug(java.lang.Object msg)
Log a DEBUG message.
|
void |
debug(java.lang.Object msg,
java.lang.Throwable t)
Log a message, with associated Throwable information.
|
void |
error(Logger.Category category,
java.lang.String msg)
Log a message with error level.
|
void |
error(Logger.Category category,
java.lang.String msg,
java.lang.Throwable t)
Log a message with error level, with associated Throwable information.
|
void |
error(java.lang.Object msg)
Log a ERROR message.
|
void |
error(java.lang.Object msg,
java.lang.Throwable t)
Log a message, with associated Throwable information.
|
void |
fatal(java.lang.Object msg)
Log a FATAL message.
|
void |
fatal(java.lang.Object msg,
java.lang.Throwable t)
Log a message, with associated Throwable information.
|
abstract java.util.logging.Level |
getLevel() |
static Logger |
getLogger(java.lang.Class<?> clazz)
Create a logger for the specified class.
|
static Logger |
getLogger(Logger loggingDelegate,
Logger levelDelegate)
Creates a new
Logger instance which performs logging through
loggingDelegate and uses levelDelegate to configure its
level. |
static Logger |
getLogger(java.lang.String name)
Create a logger for the specified name.
|
void |
info(Logger.Category category,
java.lang.String msg)
Log a message with info level.
|
void |
info(Logger.Category category,
java.lang.String msg,
java.lang.Throwable t)
Log a message with info level, with associated Throwable information.
|
void |
info(java.lang.Object msg)
Log a INFO message.
|
void |
info(java.lang.Object msg,
java.lang.Throwable t)
Log a message, with associated Throwable information.
|
boolean |
isDebugEnabled()
Check if a message with a DEBUG level would actually be logged by this
logger.
|
boolean |
isInfoEnabled()
Check if a message with an INFO level would actually be logged by this
logger.
|
(package private) abstract boolean |
isLoggable(java.util.logging.Level level)
Checks whether messages with a particular level should be logged
according to the log level configured for this
Logger . |
boolean |
isTraceEnabled()
Check if a message with a TRACE level would actually be logged by this
logger.
|
boolean |
isWarnEnabled()
Check if a message with a WARN level would actually be logged by this
logger.
|
void |
log(java.util.logging.Level level,
Logger.Category category,
java.lang.String msg)
Logs a given message with and given category at a given level, if that
level is loggable according to the log level configured by this instance.
|
void |
log(java.util.logging.Level level,
Logger.Category category,
java.lang.String msg,
java.lang.Throwable thrown)
Logs a given message with and given category at a given level, if that
level is loggable according to the log level configured by this instance.
|
abstract void |
log(java.util.logging.Level level,
java.lang.Object msg)
Logs a message at a given level, if that level is loggable according to
the log level configured by this instance.
|
abstract void |
log(java.util.logging.Level level,
java.lang.Object msg,
java.lang.Throwable thrown)
Logs a message at a given level, if that level is loggable according to
the log level configured by this instance.
|
void |
logEntry()
Logs an entry in the calling method.
|
void |
logExit()
Logs exiting the calling method
|
void |
reset()
Reinitialize the logging properties and reread the logging configuration.
|
abstract void |
setLevel(java.util.logging.Level level)
Set logging level for all handlers to level
|
void |
setLevelAll()
Set logging level for all handlers to ALL (allow all log messages)
|
void |
setLevelDebug()
Set logging level for all handlers to DEBUG
|
void |
setLevelError()
Set logging level for all handlers to ERROR
|
void |
setLevelFatal()
Set logging level for all handlers to FATAL
|
void |
setLevelInfo()
Set logging level for all handlers to INFO
|
void |
setLevelOff()
Set logging level for all handlers to OFF (allow no log messages)
|
void |
setLevelTrace()
Set logging level for all handlers to TRACE
|
void |
setLevelWarn()
Set logging level for all handlers to WARNING
|
void |
trace(java.lang.Object msg)
Log a TRACE message.
|
void |
trace(java.lang.Object msg,
java.lang.Throwable t)
Log a message, with associated Throwable information.
|
void |
warn(java.lang.Object msg)
Log a WARN message.
|
void |
warn(java.lang.Object msg,
java.lang.Throwable t)
Log a message, with associated Throwable information.
|
public static Logger getLogger(java.lang.Class<?> clazz) throws java.lang.NullPointerException
clazz
- The class for which to create a logger.
java.lang.NullPointerException
- if the class is null.public static Logger getLogger(java.lang.String name) throws java.lang.NullPointerException
java.lang.NullPointerException
- if the name is null.public static Logger getLogger(Logger loggingDelegate, Logger levelDelegate)
Logger
instance which performs logging through
loggingDelegate
and uses levelDelegate
to configure its
level.public void logEntry()
public void logExit()
public boolean isTraceEnabled()
public void trace(java.lang.Object msg)
If the logger is currently enabled for the TRACE message level then the given message is forwarded to all the registered output Handler objects.
msg
- The message to logpublic void trace(java.lang.Object msg, java.lang.Throwable t)
msg
- The message to logt
- Throwable associated with log message.public boolean isDebugEnabled()
public void debug(java.lang.Object msg)
If the logger is currently enabled for the DEBUG message level then the given message is forwarded to all the registered output Handler objects.
msg
- The message to logpublic void debug(java.lang.Object msg, java.lang.Throwable t)
msg
- The message to logt
- Throwable associated with log message.public boolean isInfoEnabled()
public void info(java.lang.Object msg)
If the logger is currently enabled for the INFO message level then the given message is forwarded to all the registered output Handler objects.
msg
- The message to logpublic void info(java.lang.Object msg, java.lang.Throwable t)
msg
- The message to logt
- Throwable associated with log message.public boolean isWarnEnabled()
public void warn(java.lang.Object msg)
If the logger is currently enabled for the WARN message level then the given message is forwarded to all the registered output Handler objects.
msg
- The message to logpublic void warn(java.lang.Object msg, java.lang.Throwable t)
msg
- The message to logt
- Throwable associated with log message.public void error(java.lang.Object msg)
If the logger is currently enabled for the ERROR message level then the given message is forwarded to all the registered output Handler objects.
msg
- The message to logpublic void error(java.lang.Object msg, java.lang.Throwable t)
msg
- The message to logt
- Throwable associated with log message.public void fatal(java.lang.Object msg)
If the logger is currently enabled for the FATAL message level then the given message is forwarded to all the registered output Handler objects.
msg
- The message to logpublic void fatal(java.lang.Object msg, java.lang.Throwable t)
msg
- The message to logt
- Throwable associated with log message.public void setLevelFatal()
public void setLevelError()
public void setLevelWarn()
public void setLevelInfo()
public void setLevelDebug()
public void setLevelTrace()
public void setLevelAll()
public void setLevelOff()
public void reset()
The same rules are used for locating the configuration properties as are used at startup. So if the properties containing the log dir locations have changed, we would read the new configuration.
public abstract void setLevel(java.util.logging.Level level)
level
- the level to set for all logger handlerspublic abstract java.util.logging.Level getLevel()
Level
configured for this Logger
.abstract boolean isLoggable(java.util.logging.Level level)
Logger
.level
- the log level.public abstract void log(java.util.logging.Level level, java.lang.Object msg)
level
- the level at which to log the message.msg
- the message to log.public abstract void log(java.util.logging.Level level, java.lang.Object msg, java.lang.Throwable thrown)
level
- the level at which to log the message.msg
- the message to log.thrown
- a Throwable
associated with log message.public void log(java.util.logging.Level level, Logger.Category category, java.lang.String msg)
level
- the level at which to log the message.category
- the category.msg
- the message to log.public void log(java.util.logging.Level level, Logger.Category category, java.lang.String msg, java.lang.Throwable thrown)
level
- the level at which to log the message.category
- the category.msg
- the message to log.thrown
- a Throwable
associated with log message.public void debug(Logger.Category category, java.lang.String msg)
msg
- The message to logcategory
- the category.public void debug(Logger.Category category, java.lang.String msg, java.lang.Throwable t)
msg
- The message to logcategory
- the category.t
- Throwable associated with log message.public void error(Logger.Category category, java.lang.String msg)
msg
- The message to logcategory
- the category.public void error(Logger.Category category, java.lang.String msg, java.lang.Throwable t)
msg
- The message to logcategory
- the category.t
- Throwable associated with log message.public void info(Logger.Category category, java.lang.String msg, java.lang.Throwable t)
category
- the category.msg
- The message to logt
- Throwable associated with log message.public void info(Logger.Category category, java.lang.String msg)
category
- the category.msg
- The message to log
Jitsi, the OpenSource Java VoIP and Instant Messaging client.
Distributable under Apache license.