Package org.apache.velocity.runtime.log
Class SystemLogChute
java.lang.Object
org.apache.velocity.runtime.log.SystemLogChute
- All Implemented Interfaces:
LogChute
Logger used when no other is configured. By default, all messages
will be printed to the System.err output stream.
- Since:
- 1.5
- Version:
- $Id: SystemLogChute.java 730039 2008-12-30 03:53:19Z byron $
-
Field Summary
FieldsFields inherited from interface org.apache.velocity.runtime.log.LogChute
DEBUG_ID, DEBUG_PREFIX, ERROR_ID, ERROR_PREFIX, INFO_ID, INFO_PREFIX, TRACE_ID, TRACE_PREFIX, WARN_ID, WARN_PREFIX -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintReturns the current minimum level at which messages will be printed.protected StringgetPrefix(int level) intReturns the current minimum level at which messages will be printed to System.err instead of System.out.voidinit(RuntimeServices rs) Initializes this LogChute.booleanisLevelEnabled(int level) This will return true if the specified level is equal to or higher than the level this LogChute is enabled for.voidLogs messages to either std.out or std.err depending on their severity.voidLogs messages to the system console so long as the specified level is equal to or greater than the level this LogChute is enabled for.voidsetEnabledLevel(int level) Set the minimum level at which messages will be printed.voidsetSystemErrLevel(int level) Set the minimum level at which messages will be printed to System.err instead of System.out.protected intprotected voidwrite(PrintStream stream, String prefix, String message, Throwable t)
-
Field Details
-
RUNTIME_LOG_LEVEL_KEY
- See Also:
-
RUNTIME_LOG_SYSTEM_ERR_LEVEL_KEY
- See Also:
-
enabled
private int enabled -
errLevel
private int errLevel
-
-
Constructor Details
-
SystemLogChute
public SystemLogChute()
-
-
Method Details
-
init
Description copied from interface:LogChuteInitializes this LogChute. -
toLevel
-
getPrefix
-
log
Logs messages to either std.out or std.err depending on their severity. -
log
Logs messages to the system console so long as the specified level is equal to or greater than the level this LogChute is enabled for. If the level is equal to or greater than LogChute.ERROR_ID, messages will be printed to System.err. Otherwise, they will be printed to System.out. If a java.lang.Throwable accompanies the message, it's stack trace will be printed to the same stream as the message. -
write
-
setEnabledLevel
public void setEnabledLevel(int level) Set the minimum level at which messages will be printed. -
getEnabledLevel
public int getEnabledLevel()Returns the current minimum level at which messages will be printed. -
setSystemErrLevel
public void setSystemErrLevel(int level) Set the minimum level at which messages will be printed to System.err instead of System.out. -
getSystemErrLevel
public int getSystemErrLevel()Returns the current minimum level at which messages will be printed to System.err instead of System.out. -
isLevelEnabled
public boolean isLevelEnabled(int level) This will return true if the specified level is equal to or higher than the level this LogChute is enabled for.- Specified by:
isLevelEnabledin interfaceLogChute- Returns:
- True if a level is enabled.
-