Class LogSystemCommonsLog
- java.lang.Object
-
- org.apache.velocity.tools.generic.log.LogSystemCommonsLog
-
- All Implemented Interfaces:
org.apache.commons.logging.Log
public class LogSystemCommonsLog extends java.lang.Object implements org.apache.commons.logging.LogRedirects commons-logging messages to Velocity's LogSystem.To use, specify this class in your commons-logging.properties:
org.apache.commons.logging.Log=org.apache.velocity.tools.generic.log.LogSystemCommonsLog- Version:
- $Id: LogSystemCommonsLog.java 493518 2007-01-06 17:47:14Z cbrisson $
-
-
Field Summary
Fields Modifier and Type Field Description protected static org.apache.velocity.app.VelocityEnginehandlerprivate booleanprintStackTrace
-
Constructor Summary
Constructors Constructor Description LogSystemCommonsLog()LogSystemCommonsLog(boolean pst)Lets you set whether or not this instance should print the full stack trace of exceptions and errors passed to it.LogSystemCommonsLog(boolean pst, java.lang.String name)Lets you set whether or not this instance should print the full stack trace of exceptions and errors passed to it.LogSystemCommonsLog(java.lang.String name)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voiddebug(java.lang.Object message)Passes messages to Velocity's LogSystem at "DEBUG" level.voiddebug(java.lang.Object message, java.lang.Throwable t)Passes messages to Velocity's LogSystem at "DEBUG" level.voiderror(java.lang.Object message)Passes messages to Velocity's LogSystem at "ERROR" level.voiderror(java.lang.Object message, java.lang.Throwable t)Passes messages to Velocity's LogSystem at "ERROR" level.voidfatal(java.lang.Object message)Passes messages to Velocity's LogSystem at "ERROR" level.voidfatal(java.lang.Object message, java.lang.Throwable t)Passes messages to Velocity's LogSystem at "ERROR" level.voidinfo(java.lang.Object message)Passes messages to Velocity's LogSystem at "INFO" level.voidinfo(java.lang.Object message, java.lang.Throwable t)Passes messages to Velocity's LogSystem at "INFO" level.booleanisDebugEnabled()Always returns true since Velocity's LogSystem doesn't provide this information.booleanisErrorEnabled()Always returns true since Velocity's LogSystem doesn't provide this information.booleanisFatalEnabled()Always returns true since Velocity's LogSystem doesn't provide this information.booleanisInfoEnabled()Always returns true since Velocity's LogSystem doesn't provide this information.booleanisTraceEnabled()Always returns true since Velocity's LogSystem doesn't provide this information.booleanisWarnEnabled()Always returns true since Velocity's LogSystem doesn't provide this information.private voidlog(int level, java.lang.Object message)private voidlog(int level, java.lang.Object message, java.lang.Throwable t)static voidsetVelocityEngine(org.apache.velocity.app.VelocityEngine engine)Set a VelocityEngine to handle all the log messages.voidtrace(java.lang.Object message)Passes messages to Velocity's LogSystem at "DEBUG" level.voidtrace(java.lang.Object message, java.lang.Throwable t)Passes messages to Velocity's LogSystem at "DEBUG" level.voidwarn(java.lang.Object message)Passes messages to Velocity's LogSystem at "WARN" level.voidwarn(java.lang.Object message, java.lang.Throwable t)Passes messages to Velocity's LogSystem at "WARN" level.
-
-
-
Constructor Detail
-
LogSystemCommonsLog
public LogSystemCommonsLog()
-
LogSystemCommonsLog
public LogSystemCommonsLog(java.lang.String name)
-
LogSystemCommonsLog
public LogSystemCommonsLog(boolean pst)
Lets you set whether or not this instance should print the full stack trace of exceptions and errors passed to it.It should be possible to create a LogFactory implementation that takes advantage of this constructor.
- Parameters:
pst- if true, stack traces will be printed
-
LogSystemCommonsLog
public LogSystemCommonsLog(boolean pst, java.lang.String name)Lets you set whether or not this instance should print the full stack trace of exceptions and errors passed to it.It should be possible to create a LogFactory implementation that takes advantage of this constructor.
- Parameters:
pst- if true, stack traces will be printedname- the name of this logger
-
-
Method Detail
-
setVelocityEngine
public static void setVelocityEngine(org.apache.velocity.app.VelocityEngine engine)
Set a VelocityEngine to handle all the log messages.
-
log
private void log(int level, java.lang.Object message)
-
log
private void log(int level, java.lang.Object message, java.lang.Throwable t)
-
trace
public void trace(java.lang.Object message)
Passes messages to Velocity's LogSystem at "DEBUG" level. (it's the lowest available. sorry.)- Specified by:
tracein interfaceorg.apache.commons.logging.Log
-
trace
public void trace(java.lang.Object message, java.lang.Throwable t)Passes messages to Velocity's LogSystem at "DEBUG" level. (it's the lowest available. sorry.)- Specified by:
tracein interfaceorg.apache.commons.logging.Log
-
debug
public void debug(java.lang.Object message)
Passes messages to Velocity's LogSystem at "DEBUG" level.- Specified by:
debugin interfaceorg.apache.commons.logging.Log
-
debug
public void debug(java.lang.Object message, java.lang.Throwable t)Passes messages to Velocity's LogSystem at "DEBUG" level.- Specified by:
debugin interfaceorg.apache.commons.logging.Log
-
info
public void info(java.lang.Object message)
Passes messages to Velocity's LogSystem at "INFO" level.- Specified by:
infoin interfaceorg.apache.commons.logging.Log
-
info
public void info(java.lang.Object message, java.lang.Throwable t)Passes messages to Velocity's LogSystem at "INFO" level.- Specified by:
infoin interfaceorg.apache.commons.logging.Log
-
warn
public void warn(java.lang.Object message)
Passes messages to Velocity's LogSystem at "WARN" level.- Specified by:
warnin interfaceorg.apache.commons.logging.Log
-
warn
public void warn(java.lang.Object message, java.lang.Throwable t)Passes messages to Velocity's LogSystem at "WARN" level.- Specified by:
warnin interfaceorg.apache.commons.logging.Log
-
error
public void error(java.lang.Object message)
Passes messages to Velocity's LogSystem at "ERROR" level.- Specified by:
errorin interfaceorg.apache.commons.logging.Log
-
error
public void error(java.lang.Object message, java.lang.Throwable t)Passes messages to Velocity's LogSystem at "ERROR" level.- Specified by:
errorin interfaceorg.apache.commons.logging.Log
-
fatal
public void fatal(java.lang.Object message)
Passes messages to Velocity's LogSystem at "ERROR" level. (it's the highest available. sorry.)- Specified by:
fatalin interfaceorg.apache.commons.logging.Log
-
fatal
public void fatal(java.lang.Object message, java.lang.Throwable t)Passes messages to Velocity's LogSystem at "ERROR" level. (it's the highest available. sorry.)- Specified by:
fatalin interfaceorg.apache.commons.logging.Log
-
isTraceEnabled
public boolean isTraceEnabled()
Always returns true since Velocity's LogSystem doesn't provide this information.- Specified by:
isTraceEnabledin interfaceorg.apache.commons.logging.Log- Returns:
- true
-
isDebugEnabled
public boolean isDebugEnabled()
Always returns true since Velocity's LogSystem doesn't provide this information.- Specified by:
isDebugEnabledin interfaceorg.apache.commons.logging.Log- Returns:
- true
-
isInfoEnabled
public boolean isInfoEnabled()
Always returns true since Velocity's LogSystem doesn't provide this information.- Specified by:
isInfoEnabledin interfaceorg.apache.commons.logging.Log- Returns:
- true
-
isWarnEnabled
public boolean isWarnEnabled()
Always returns true since Velocity's LogSystem doesn't provide this information.- Specified by:
isWarnEnabledin interfaceorg.apache.commons.logging.Log- Returns:
- true
-
isErrorEnabled
public boolean isErrorEnabled()
Always returns true since Velocity's LogSystem doesn't provide this information.- Specified by:
isErrorEnabledin interfaceorg.apache.commons.logging.Log- Returns:
- true
-
isFatalEnabled
public boolean isFatalEnabled()
Always returns true since Velocity's LogSystem doesn't provide this information.- Specified by:
isFatalEnabledin interfaceorg.apache.commons.logging.Log- Returns:
- true
-
-