public class Logger extends Object
finest -> finest trace -> finer debug-> fine info -> info warn -> warning error -> severe fatal -> severe
| Modifier and Type | Field and Description |
|---|---|
static boolean |
configurationDone |
protected ScheduledExecutorService |
executor |
| Modifier and Type | Method and Description |
|---|---|
static void |
configure() |
LogRecord |
createLogRecord(Level level,
String message)
creates a simple log record.
|
boolean |
debug(Object message,
String... concerns)
logs a message at FINE Level
|
void |
debug(Object message,
Throwable throwable,
String... concerns)
logs a message at FINE Level
|
boolean |
decoupledLog(long delay,
Level level,
String message,
Object[] arguments,
String... concerns)
does the same as the corresponding log method but executed
in a different Thread.
|
boolean |
decoupledLog(long delay,
Level level,
String message,
Object argument,
String... concerns)
same method as public boolean log(Level level, String message,
Object argument, String...
|
void |
decoupledLog(long delay,
Level level,
String message,
Throwable throwable,
String... concerns)
does the same as the corresponding log method but executed
in a different Thread.
|
void |
decoupledLog(long delay,
LogRecord record,
String... concerns)
same method as log(LogRecord, String...
|
void |
error(Object message,
String... concerns)
logs a message at SEVERE Level (use preferably the error method that
uses a Throwable parameter)
|
void |
error(Object message,
Throwable throwable,
String... concerns)
logs a message at SEVERE Level
|
void |
fatal(Object message,
String... concerns)
logs a message at SEVERE Level (use preferably the fatal method that
uses a Throwable parameter)
|
void |
fatal(Object message,
Throwable throwable,
String... concerns)
logs a message at SEVERE Level
|
boolean |
fine(Object message,
String... concerns)
logs a message at FINE Level
|
boolean |
finer(Object message,
String... concerns)
logs a message at FINER level
|
boolean |
finest(Object message,
String... concerns)
logs a message at FINEST level
|
Level |
getLevel() |
static Logger |
getLogger(String name)
factory method to obtain a Logger proxy.
|
static Logger |
getLogger(String name,
String resourceBundleName)
factory method to obtain a Logger proxy.
|
String |
getName() |
boolean |
info(Object message,
String... concerns)
logs a message at INFO Level
|
void |
info(Object message,
Throwable throwable,
String... concerns)
logs a message at INFO Level
|
boolean |
isDebugEnabled()
tells if the FINE level is activated for the corresponding JUL
Logger.
|
boolean |
isInfoEnabled()
tells if the INFO level is activated for the corresponding JUL
Logger.
|
boolean |
isLoggable(Level level)
tells if the corresponding JUL level is activated for the
corresponding JUL Logger.
|
boolean |
log(Level level,
String message,
Object[] arguments,
String... concerns)
does the same as the equivalent standard JUL method but forwards also
to other Loggers.
|
boolean |
log(Level level,
String message,
Object argument,
String... concerns)
does the same as the equivalent standard JUL method but forwards also
to other Loggers.
|
void |
log(Level level,
String message,
Throwable throwable,
String... concerns)
does the same as the equivalent standard JUL method but forwards also
to other Loggers.
|
void |
log(LogRecord record,
String... concerns)
utility method to send a LogRecord to the corresponding JUL
logger and to a list of other loggers.
|
protected boolean |
logMessage(Level level,
Object message,
String... concerns)
utility method to log a message with a Level
|
protected void |
logSimpleThrowable(Level level,
Object message,
Throwable throwable,
String... concerns)
utility method to forward a Throwable and a message to the
loggers.
|
void |
severe(Object message,
String... concerns)
logs a message at SEVERE Level (use preferably the severe method that
uses a Throwable parameter)
|
void |
severe(Object message,
Throwable throwable,
String... concerns)
logs a message at SEVERE Level
|
void |
throwing(String sourceClass,
String sourceMethod,
Throwable throwable)
invokes the throwing method on the corresponding JUL logger.
|
boolean |
trace(Object message,
String... concerns)
logs a message at FINER level
|
boolean |
warn(Object message,
String... concerns)
logs a message at WARNING Level
|
void |
warn(Object message,
Throwable throwable,
String... concerns)
logs a message at WARNING Level
|
boolean |
warning(Object message,
String... concerns)
logs a message at WARNING Level
|
void |
warning(Object message,
Throwable throwable,
String... concerns)
logs a message at WARNING Level
|
protected ScheduledExecutorService executor
public static volatile boolean configurationDone
public static Logger getLogger(String name)
name - usually a package name (top of hierarchy is "" empty
String)public static Logger getLogger(String name, String resourceBundleName)
name - usually a package name (top of hierarchy is "" empty
String)resourceBundleName - public String getName()
public Level getLevel()
public LogRecord createLogRecord(Level level, String message)
level - JUL Levelmessage - (avoid null values)protected boolean logMessage(Level level, Object message, String... concerns)
level - JUL levelmessage - (avoid null values)concerns - a list of additional JUL loggers name (such as
"INIT", "CONFIG" ,...)public boolean finest(Object message, String... concerns)
message - concerns - a list of additional JUL loggers name (such as
"INIT", "CONFIG" ,...)public boolean trace(Object message, String... concerns)
message - concerns - a list of additional JUL loggers name (such as
"INIT", "CONFIG" ,...)public boolean finer(Object message, String... concerns)
message - concerns - a list of additional JUL loggers name (such as
"INIT", "CONFIG" ,...)public boolean debug(Object message, String... concerns)
message - concerns - a list of additional JUL loggers name (such as
"INIT", "CONFIG" ,...)public boolean fine(Object message, String... concerns)
message - concerns - a list of additional JUL loggers name (such as
"INIT", "CONFIG" ,...)public boolean info(Object message, String... concerns)
message - concerns - a list of additional JUL loggers name (such as
"INIT", "CONFIG" ,...)public boolean warn(Object message, String... concerns)
message - concerns - a list of additional JUL loggers name (such as
"INIT", "CONFIG" ,...)public boolean warning(Object message, String... concerns)
message - concerns - a list of additional JUL loggers name (such as
"INIT", "CONFIG" ,...)public void error(Object message, String... concerns)
message - concerns - a list of additional JUL loggers name (such as
"INIT", "CONFIG" ,...)public void fatal(Object message, String... concerns)
message - concerns - a list of additional JUL loggers name (such as
"INIT", "CONFIG" ,...)public void severe(Object message, String... concerns)
message - concerns - a list of additional JUL loggers name (such as
"INIT", "CONFIG" ,...)public boolean isDebugEnabled()
public boolean isInfoEnabled()
protected void logSimpleThrowable(Level level, Object message, Throwable throwable, String... concerns)
level - JUL levelmessage - throwable - concerns - a list of additional JUL loggers name (such as
"INIT", "CONFIG" ,...)public void fatal(Object message, Throwable throwable, String... concerns)
message - throwable - concerns - a list of additional JUL loggers name (such as
"INIT", "CONFIG" ,...)public void severe(Object message, Throwable throwable, String... concerns)
message - throwable - concerns - a list of additional JUL loggers name (such as
"INIT", "CONFIG" ,...)public void error(Object message, Throwable throwable, String... concerns)
message - throwable - concerns - a list of additional JUL loggers name (such as
"INIT", "CONFIG" ,...)public void warn(Object message, Throwable throwable, String... concerns)
message - throwable - concerns - a list of additional JUL loggers name (such as
"INIT", "CONFIG" ,...)public void warning(Object message, Throwable throwable, String... concerns)
message - throwable - concerns - a list of additional JUL loggers name (such as
"INIT", "CONFIG" ,...)public void throwing(String sourceClass, String sourceMethod, Throwable throwable)
sourceClass - sourceMethod - throwable - public void info(Object message, Throwable throwable, String... concerns)
message - throwable - concerns - a list of additional JUL loggers name (such as
"INIT", "CONFIG" ,...)public void debug(Object message, Throwable throwable, String... concerns)
message - throwable - concerns - a list of additional JUL loggers name (such as
"INIT", "CONFIG" ,...)public boolean isLoggable(Level level)
public void log(LogRecord record, String... concerns)
record - (should be created with the createLogRecord
factory :otherwise stack information will be wrong)concerns - a list of additional JUL loggers name (such as
"INIT", "CONFIG" ,...)public void decoupledLog(long delay,
LogRecord record,
String... concerns)
delay - in millisrecord - concerns - public boolean log(Level level, String message, Object argument, String... concerns)
level - JUL levelmessage - argument - concerns - a list of additional JUL loggers name (such as
"INIT", "CONFIG" ,...)public boolean decoupledLog(long delay,
Level level,
String message,
Object argument,
String... concerns)
delay - in Millisecondslevel - message - argument - concerns - public boolean log(Level level, String message, Object[] arguments, String... concerns)
level - JUL levelmessage - arguments - concerns - a list of additional JUL loggers name (such as
"INIT", "CONFIG" ,...)public boolean decoupledLog(long delay,
Level level,
String message,
Object[] arguments,
String... concerns)
delay - in millislevel - message - arguments - concerns - public void log(Level level, String message, Throwable throwable, String... concerns)
level - JUL levelmessage - throwable - concerns - a list of additional JUL loggers name (such as
"INIT", "CONFIG" ,...)public void decoupledLog(long delay,
Level level,
String message,
Throwable throwable,
String... concerns)
delay - in millislevel - message - throwable - concerns - public static void configure()
Copyright © 2014 LSST. All Rights Reserved.