| Modifier and Type | Field and Description |
|---|---|
static Level |
defaultLevel
Default logging level for
ConsoleLogger |
static PrintStream |
defaultOutput
Default output stream for
ConsoleLogger |
| Constructor and Description |
|---|
ConsoleLogger(String name)
Create a
ConsoleLogger with the supplied name and the default level and output stream. |
ConsoleLogger(String name,
Level level)
Create a
ConsoleLogger with the supplied name and level and the default output stream. |
ConsoleLogger(String name,
Level level,
PrintStream output)
Create a
ConsoleLogger with the supplied name, level and output stream. |
ConsoleLogger(String name,
PrintStream output)
Create a
ConsoleLogger with the supplied name and output stream and the default level. |
| Modifier and Type | Method and Description |
|---|---|
void |
debug(Object message)
Output a debug message.
|
void |
error(Object message)
Output an error message.
|
void |
error(Object message,
Throwable throwable)
Output an error message along with a
Throwable. |
Level |
getLevel()
Get the minimum level to be output by this
ConsoleLogger. |
String |
getName()
Get the name associated with this
ConsoleLogger. |
PrintStream |
getOutput()
Get the output stream associated with this
ConsoleLogger. |
char |
getSeparator()
Get the character separator used to format output messages.
|
void |
info(Object message)
Output an info message.
|
boolean |
isDebugEnabled()
Test whether debug output is enabled for this
ConsoleLogger. |
boolean |
isErrorEnabled()
Test whether error output is enabled for this
ConsoleLogger. |
boolean |
isInfoEnabled()
Test whether info output is enabled for this
ConsoleLogger. |
boolean |
isTraceEnabled()
Test whether trace output is enabled for this
ConsoleLogger. |
boolean |
isWarnEnabled()
Test whether warning output is enabled for this
ConsoleLogger. |
void |
setLevel(Level level)
Set the minimum level to be output by this
ConsoleLogger. |
void |
setSeparator(char separator)
Set the character separator used to format output messages.
|
void |
trace(Object message)
Output a trace message.
|
void |
warn(Object message)
Output a warning message.
|
public static final Level defaultLevel
ConsoleLoggerpublic static final PrintStream defaultOutput
ConsoleLoggerpublic ConsoleLogger(String name, Level level, PrintStream output)
ConsoleLogger with the supplied name, level and output stream.name - the name to be associated with logging messageslevel - the minimum level to be outputoutput - the output streampublic ConsoleLogger(String name, Level level)
ConsoleLogger with the supplied name and level and the default output stream.name - the name to be associated with logging messageslevel - the minimum level to be outputpublic ConsoleLogger(String name, PrintStream output)
ConsoleLogger with the supplied name and output stream and the default level.name - the name to be associated with logging messagesoutput - the output streampublic ConsoleLogger(String name)
ConsoleLogger with the supplied name and the default level and output stream.name - the name to be associated with logging messagespublic String getName()
ConsoleLogger.public Level getLevel()
ConsoleLogger.public void setLevel(Level level)
ConsoleLogger.level - the new levelpublic PrintStream getOutput()
ConsoleLogger.public char getSeparator()
public void setSeparator(char separator)
separator - the new separatorpublic boolean isTraceEnabled()
ConsoleLogger.isTraceEnabled in interface Loggertrue if trace output is enabledpublic boolean isDebugEnabled()
ConsoleLogger.isDebugEnabled in interface Loggertrue if debug output is enabledpublic boolean isInfoEnabled()
ConsoleLogger.isInfoEnabled in interface Loggertrue if info output is enabledpublic boolean isWarnEnabled()
ConsoleLogger.isWarnEnabled in interface Loggertrue if warning output is enabledpublic boolean isErrorEnabled()
ConsoleLogger.isErrorEnabled in interface Loggertrue if error output is enabledpublic void trace(Object message)
trace in interface Loggermessage - the message (will be output using Object.toString()public void debug(Object message)
debug in interface Loggermessage - the message (will be output using Object.toString()public void info(Object message)
info in interface Loggermessage - the message (will be output using Object.toString()public void warn(Object message)
warn in interface Loggermessage - the message (will be output using Object.toString()public void error(Object message)
error in interface Loggermessage - the message (will be output using Object.toString()Copyright © 2021. All rights reserved.