| java.lang.Object freemarker.log.Logger
Logger | abstract public class Logger (Code) | | The FreeMarker logging facility. This is a polymorphic implementation
that will use whatever logging package it can find on the system:
Apache Jakarta Log4J, Apache Jakarta Avalon LogKit, JDK1.4 logging
(in this order). If it fails to find any of the above, logging will
be suppressed and a short notice output to System.err. You can use the
Logger.selectLoggerLibrary(int) static method to force use of a specific
logger package, or to turn off logging.
version: $Id: Logger.java,v 1.24 2003/10/03 15:35:10 stephanmueller Exp $ author: Attila Szegedi |
Method Summary | |
abstract public void | debug(String message) Logs a debugging message. | abstract public void | debug(String message, Throwable t) Logs a debugging message with accompanying throwable. | abstract public void | error(String message) Logs an error message. | abstract public void | error(String message, Throwable t) Logs an error message with accompanying throwable. | public static Logger | getLogger(String category) Returns a logger for the specified category.
Parameters: category - a dot separated hierarchical category name. | abstract public void | info(String message) Logs an informational message. | abstract public void | info(String message, Throwable t) Logs an informational message with accompanying throwable. | abstract public boolean | isDebugEnabled() Returns true if this logger will log debug messages. | abstract public boolean | isErrorEnabled() Returns true if this logger will log error messages. | abstract public boolean | isFatalEnabled() Returns true if this logger will log fatal error messages. | abstract public boolean | isInfoEnabled() Returns true if this logger will log informational messages. | abstract public boolean | isWarnEnabled() Returns true if this logger will log warning messages. | public static void | selectLoggerLibrary(int library) Selects the logger library to use.
If you want to change the default setting, do it early in application
initialization phase, before calling any other FreeMarker API since once
various parts of the FreeMarker library bind to the logging subsystem,
the change in this value will have no effect on them.
Parameters: library - one of LIBRARY_XXX constants. | public static void | setCategoryPrefix(String prefix) Sets a category prefix. | abstract public void | warn(String message) Logs a warning message. | abstract public void | warn(String message, Throwable t) Logs a warning message with accompanying throwable. |
LIBRARY_AUTO | final public static int LIBRARY_AUTO(Code) | | Constant used with
Logger.selectLoggerLibrary(int) that indicates the
engine should automatically lookup and use any available logger library.
|
LIBRARY_AVALON | final public static int LIBRARY_AVALON(Code) | | Constant used with
Logger.selectLoggerLibrary(int) that indicates the
engine should use the Apache Jakarta Avalon LogKit logger package.
|
LIBRARY_LOG4J | final public static int LIBRARY_LOG4J(Code) | | Constant used with
Logger.selectLoggerLibrary(int) that indicates the
engine should use the Apache Jakarta Log4J logger package.
|
LIBRARY_NONE | final public static int LIBRARY_NONE(Code) | | Constant used with
Logger.selectLoggerLibrary(int) that indicates the
engine should use no logger package (i.e. turn off logging).
|
debug | abstract public void debug(String message)(Code) | | Logs a debugging message.
|
debug | abstract public void debug(String message, Throwable t)(Code) | | Logs a debugging message with accompanying throwable.
|
error | abstract public void error(String message)(Code) | | Logs an error message.
|
error | abstract public void error(String message, Throwable t)(Code) | | Logs an error message with accompanying throwable.
|
getLogger | public static Logger getLogger(String category)(Code) | | Returns a logger for the specified category.
Parameters: category - a dot separated hierarchical category name. If a categoryprefix is in effect, it is prepended to the category name. |
info | abstract public void info(String message)(Code) | | Logs an informational message.
|
info | abstract public void info(String message, Throwable t)(Code) | | Logs an informational message with accompanying throwable.
|
isDebugEnabled | abstract public boolean isDebugEnabled()(Code) | | Returns true if this logger will log debug messages.
|
isErrorEnabled | abstract public boolean isErrorEnabled()(Code) | | Returns true if this logger will log error messages.
|
isFatalEnabled | abstract public boolean isFatalEnabled()(Code) | | Returns true if this logger will log fatal error messages.
|
isInfoEnabled | abstract public boolean isInfoEnabled()(Code) | | Returns true if this logger will log informational messages.
|
isWarnEnabled | abstract public boolean isWarnEnabled()(Code) | | Returns true if this logger will log warning messages.
|
selectLoggerLibrary | public static void selectLoggerLibrary(int library) throws ClassNotFoundException(Code) | | Selects the logger library to use.
If you want to change the default setting, do it early in application
initialization phase, before calling any other FreeMarker API since once
various parts of the FreeMarker library bind to the logging subsystem,
the change in this value will have no effect on them.
Parameters: library - one of LIBRARY_XXX constants. By default,Logger.LIBRARY_AUTO is used. throws: ClassNotFoundException - if an explicit logging library is asked for(that is, neither NONE, nor AUTO), and it is not found in the classpath. |
setCategoryPrefix | public static void setCategoryPrefix(String prefix)(Code) | | Sets a category prefix. This prefix is prepended to any logger category
name. This makes it possible to have different FreeMarker logger categories
on a per-application basis (better said, per-classloader basis). By default
the category prefix is the empty string. If you set a non-empty category
prefix, be sure to include the trailing separator dot (i.e. "MyApp.")
If you want to change the default setting, do it early in application
initialization phase, before calling any other FreeMarker API since once
various parts of the FreeMarker library bind to the logging subsystem,
the change in this value will have no effect on them.
|
warn | abstract public void warn(String message)(Code) | | Logs a warning message.
|
warn | abstract public void warn(String message, Throwable t)(Code) | | Logs a warning message with accompanying throwable.
|
|
|