Class Logger
java.lang.Object
org.codehaus.groovy.tools.shell.util.Logger
Provides a very, very basic logging API.
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionstatic LoggerCreates a logger named after the supplied type.static LoggerCreates a logger named after the supplied type plus a suffix.voidLogs a debug message when debug output is enabled.voidLogs a debug message and cause when debug output is enabled.voidLogs an error message.voidLogs an error message and cause.booleanisDebug()Alias forisDebugEnabled().booleanReturns whether debug-level logging is currently enabled.voidLogs a warning message.voidLogs a warning message and cause.
-
Field Details
-
io
Shared shell I/O used to emit log messages. -
name
Logger name shown in rendered log messages.
-
-
Method Details
-
isDebugEnabled
public boolean isDebugEnabled()Returns whether debug-level logging is currently enabled.- Returns:
trueif debug messages should be emitted
-
isDebug
public boolean isDebug()Alias forisDebugEnabled().- Returns:
trueif debug messages should be emitted
-
debug
Logs a debug message when debug output is enabled.- Parameters:
msg- the message to log
-
debug
Logs a debug message and cause when debug output is enabled.- Parameters:
msg- the message to logcause- the associated cause
-
warn
Logs a warning message.- Parameters:
msg- the message to log
-
warn
Logs a warning message and cause.- Parameters:
msg- the message to logcause- the associated cause
-
error
Logs an error message.- Parameters:
msg- the message to log
-
error
Logs an error message and cause.- Parameters:
msg- the message to logcause- the associated cause
-
create
Creates a logger named after the supplied type.- Parameters:
type- the type whose name should be used- Returns:
- a logger for the type
-
create
Creates a logger named after the supplied type plus a suffix.- Parameters:
type- the base type whose name should be usedsuffix- the suffix to append- Returns:
- a logger for the type and suffix
-