Package org.apache.velocity.runtime.log
Class Log
java.lang.Object
org.apache.velocity.runtime.log.Log
- Direct Known Subclasses:
LogDisplayWrapper
,RuntimeLoggerLog
Convenient wrapper for LogChute functions. This implements
the RuntimeLogger methods (and then some). It is hoped that
use of this will fully replace use of the RuntimeLogger.
- Since:
- 1.5
- Version:
- $Id: Log.java 724804 2008-12-09 18:17:08Z nbubna $
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
Log a debug message.void
Log a debug message and accompanying Throwable.void
Log an error message.void
Log an error message and accompanying Throwable.static final String
formatFileString
(String template, int linenum, int colnum) Simply creates a string that formats the template filename with line number and column.static final String
formatFileString
(Directive directive) Creates a string that formats the template filename with line number and column of the given Directive.static final String
formatFileString
(Node node) Creates a string that formats the template filename with line number and column of the given Node.static final String
formatFileString
(Info info) Simply creates a string that formats the template filename with line number and column.protected LogChute
Returns the LogChute wrapped by this Log instance.void
Log an info message.void
Log an info message and accompanying Throwable.boolean
Returns true if debug level messages will be printed by the LogChute.boolean
Returns true if error level messages will be printed by the LogChute.boolean
Returns true if info level messages will be printed by the LogChute.boolean
Returns true if trace level messages will be printed by the LogChute.boolean
Returns true if warn level messages will be printed by the LogChute.protected void
protected void
protected void
setLogChute
(LogChute chute) Updates the LogChute wrapped by this Log instance.void
Log a trace message.void
Log a trace message and accompanying Throwable.void
Log a warning message.void
Log a warning message and accompanying Throwable.
-
Field Details
-
chute
-
-
Constructor Details
-
Log
public Log()Creates a new Log that wraps a HoldingLogChute. -
Log
Creates a new Log that wraps the specified LogChute.- Parameters:
chute
-
-
-
Method Details
-
setLogChute
Updates the LogChute wrapped by this Log instance.- Parameters:
chute
- The new value for the log chute.
-
getLogChute
Returns the LogChute wrapped by this Log instance.- Returns:
- The LogChute wrapped by this Log instance.
-
log
-
log
-
isTraceEnabled
public boolean isTraceEnabled()Returns true if trace level messages will be printed by the LogChute.- Returns:
- If trace level messages will be printed by the LogChute.
-
trace
Log a trace message.- Parameters:
message
-
-
trace
Log a trace message and accompanying Throwable.- Parameters:
message
-t
-
-
isDebugEnabled
public boolean isDebugEnabled()Returns true if debug level messages will be printed by the LogChute.- Returns:
- True if debug level messages will be printed by the LogChute.
-
debug
Log a debug message.- Parameters:
message
-
-
debug
Log a debug message and accompanying Throwable.- Parameters:
message
-t
-
-
isInfoEnabled
public boolean isInfoEnabled()Returns true if info level messages will be printed by the LogChute.- Returns:
- True if info level messages will be printed by the LogChute.
-
info
Log an info message.- Parameters:
message
-
-
info
Log an info message and accompanying Throwable.- Parameters:
message
-t
-
-
isWarnEnabled
public boolean isWarnEnabled()Returns true if warn level messages will be printed by the LogChute.- Returns:
- True if warn level messages will be printed by the LogChute.
-
warn
Log a warning message.- Parameters:
message
-
-
warn
Log a warning message and accompanying Throwable.- Parameters:
message
-t
-
-
isErrorEnabled
public boolean isErrorEnabled()Returns true if error level messages will be printed by the LogChute.- Returns:
- True if error level messages will be printed by the LogChute.
-
error
Log an error message.- Parameters:
message
-
-
error
Log an error message and accompanying Throwable.- Parameters:
message
-t
-
-
formatFileString
Creates a string that formats the template filename with line number and column of the given Directive. We use this routine to provide a cosistent format for displaying file errors. -
formatFileString
Creates a string that formats the template filename with line number and column of the given Node. We use this routine to provide a cosistent format for displaying file errors. -
formatFileString
Simply creates a string that formats the template filename with line number and column. We use this routine to provide a cosistent format for displaying file errors. -
formatFileString
Simply creates a string that formats the template filename with line number and column. We use this routine to provide a cosistent format for displaying file errors.- Parameters:
template
- File name of template, can be nulllinenum
- Line number within the filecolnum
- Column number withing the file at linenum
-