|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.iparelan.util.UtilLogger
@Singleton @Copyright(value="Copyright © 2008, Iparelan Solutions, LLC. All rights reserved.") final class UtilLogger
A specialized Logger
that can log
messages before a logging service has been started. This Logger
writes log messages to the standard error
stream
.
The isLoggable*()
predicates always produce true
because
this logger is not configurable.
The system property SILENCE_PROPERTY_NAME
can be used to elide
all output from this logger. Its default value is SILENCE_PROPERTY_DEFAULT
.
Nested Class Summary | |
---|---|
private static class |
UtilLogger.LoggerHolder
|
Field Summary | |
---|---|
private static AtomicBoolean |
enforceSingletonDynamically
|
private static boolean |
SILENCE
|
static String |
SILENCE_PROPERTY_DEFAULT
|
static String |
SILENCE_PROPERTY_NAME
|
Constructor Summary | |
---|---|
private |
UtilLogger()
Not externally instantiable. |
Method Summary | |
---|---|
void |
config(String msg)
Logs a message at the config level. |
void |
config(String msg,
Throwable throwable)
Logs a message at the config level. |
void |
fine(String msg)
Logs a message at the fine level. |
void |
fine(String msg,
Throwable throwable)
Logs a message at the fine level. |
void |
finer(String msg)
Logs a message at the finer level. |
void |
finer(String msg,
Throwable throwable)
Logs a message at the finer level. |
void |
finest(String msg)
Logs a message at the finest level. |
void |
finest(String msg,
Throwable throwable)
Logs a message at the finest level. |
(package private) static Logger |
getLogger()
Produces the singleton instance. |
void |
info(String msg)
Logs a message at the info level. |
void |
info(String msg,
Throwable throwable)
Logs a message at the info level. |
boolean |
isLoggableConfig()
Tells whether messages at the config level will be logged. |
boolean |
isLoggableFine()
Tells whether messages at the fine level will be logged. |
boolean |
isLoggableFiner()
Tells whether messages at the finer level will be logged. |
boolean |
isLoggableFinest()
Tells whether messages at the finest level will be logged. |
boolean |
isLoggableInfo()
Tells whether messages at the info level will be logged. |
boolean |
isLoggableSevere()
Tells whether messages at the severe level will be logged. |
boolean |
isLoggableWarning()
Tells whether messages at the warning level will be logged. |
private void |
log(String msg)
Emits msg to the standard error stream. |
private void |
log(String msg,
Throwable throwable)
Emits msg and throwable to the standard error stream. |
void |
severe(String msg)
Logs a message at the severe level. |
void |
severe(String msg,
Throwable throwable)
Logs a message at the severe level. |
void |
warning(String msg)
Logs a message at the warning level. |
void |
warning(String msg,
Throwable throwable)
Logs a message at the warning level. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private static final AtomicBoolean enforceSingletonDynamically
public static final String SILENCE_PROPERTY_NAME
public static final String SILENCE_PROPERTY_DEFAULT
private static final boolean SILENCE
Constructor Detail |
---|
private UtilLogger()
Method Detail |
---|
static Logger getLogger()
null
.public void config(String msg)
Logger
config
in interface Logger
msg
- The log message. May not be null
.public void config(String msg, Throwable throwable)
Logger
config
in interface Logger
msg
- The log message. May not be null
.throwable
- The throwable associated with the log message. May not be null
.public void fine(String msg)
Logger
fine
in interface Logger
msg
- The log message. May not be null
.public void fine(String msg, Throwable throwable)
Logger
fine
in interface Logger
msg
- The log message. May not be null
.throwable
- The throwable associated with the log message. May not be null
.public void finer(String msg)
Logger
finer
in interface Logger
msg
- The log message. May not be null
.public void finer(String msg, Throwable throwable)
Logger
finer
in interface Logger
msg
- The log message. May not be null
.throwable
- The throwable associated with the log message. May not be null
.public void finest(String msg)
Logger
finest
in interface Logger
msg
- The log message. May not be null
.public void finest(String msg, Throwable throwable)
Logger
finest
in interface Logger
msg
- The log message. May not be null
.throwable
- The throwable associated with the log message. May not be null
.public void info(String msg)
Logger
info
in interface Logger
msg
- The log message. May not be null
.public void info(String msg, Throwable throwable)
Logger
info
in interface Logger
msg
- The log message. May not be null
.throwable
- The throwable associated with the log message. May not be null
.public void severe(String msg)
Logger
severe
in interface Logger
msg
- The log message. May not be null
.public void severe(String msg, Throwable throwable)
Logger
severe
in interface Logger
msg
- The log message. May not be null
.throwable
- The throwable associated with the log message. May not be null
.public void warning(String msg)
Logger
warning
in interface Logger
msg
- The log message. May not be null
.public void warning(String msg, Throwable throwable)
Logger
warning
in interface Logger
msg
- The log message. May not be null
.throwable
- The throwable associated with the log message. May not be null
.public boolean isLoggableConfig()
Logger
isLoggableConfig
in interface Logger
true
if messages will be logged at the config level,
otherwise false
.public boolean isLoggableFine()
Logger
isLoggableFine
in interface Logger
true
if messages will be logged at the fine level,
otherwise false
.public boolean isLoggableFiner()
Logger
isLoggableFiner
in interface Logger
true
if messages will be logged at the finer level,
otherwise false
.public boolean isLoggableFinest()
Logger
isLoggableFinest
in interface Logger
true
if messages will be logged at the finest level,
otherwise false
.public boolean isLoggableInfo()
Logger
isLoggableInfo
in interface Logger
true
if messages will be logged at the info level,
otherwise false
.public boolean isLoggableSevere()
Logger
isLoggableSevere
in interface Logger
true
if messages will be logged at the severe level,
otherwise false
.public boolean isLoggableWarning()
Logger
isLoggableWarning
in interface Logger
true
if messages will be logged at the warning level,
otherwise false
.private void log(String msg)
msg
to the standard error stream.
msg
- The message to send to the standard error stream. May not be
null
.private void log(String msg, Throwable throwable)
msg
and throwable
to the standard error stream.
msg
- The message to send to the standard error stream. May not be
null
.throwable
- The Throwable
associated with msg
. May
not be null
.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |