[Jukebox-cvs] CVS update: J4/src/java/gnu/j4/core AbstractSyslogFilter.java
Brought to you by:
vtt
From: CVS B. <vt...@fr...> - 2000-09-13 19:26:03
|
User: vt Date: 00/09/13 12:25:50 Added: src/java/gnu/j4/core AbstractSyslogFilter.java Log: Oops, another one. Revision Changes Path 1.1 J4/src/java/gnu/j4/core/AbstractSyslogFilter.java CVSWEB Options: ------------------- CVSWeb: Annotate this file: http://cvs.sourceforge.net/cgi-bin/cvsweb.cgi/J4/src/java/gnu/j4/core/AbstractSyslogFilter.java?annotate=1.1&cvsroot=jukebox4 CVSWeb: View this file: http://cvs.sourceforge.net/cgi-bin/cvsweb.cgi/J4/src/java/gnu/j4/core/AbstractSyslogFilter.java?rev=1.1&content-type=text/x-cvsweb-markup&cvsroot=jukebox4 ----------------------------------- Index: AbstractSyslogFilter.java =================================================================== package gnu.j4.core; import gnu.j4.config.Configurable; import gnu.j4.config.Configuration; /** * Syslog facility filter. * * Allows the log facilities to be filtered from the output. * * @author Copyright © <a href="mailto:vt...@fr...">Vadim Tkachenko</a> 1995-2000 * @version $Id: AbstractSyslogFilter.java,v 1.1 2000/09/13 19:25:50 vt Exp $ * @since Jukebox v4 2.0p10 */ public abstract class AbstractSyslogFilter implements Configurable, LogLevels, LogConfigKeywords { private String configurationRoot; /** * Master configuration. */ protected Configuration conf; /** * Find out if the combination of the log level and facility is enabled. * * @param ll Log level. * * @param facility Log facility. * * @return true if the given combination is allowed to be written. * * @deprecated Use {@link #isEnabled(gnu.j4.core.LogRecord) * isEnabled(LogRecord)} instead. This method used to be abstract, * currently, to support the compatibility, it creates a dummy log * record with the given log level and facility, which is an overhead * and is to be avoided. */ public boolean isEnabled(LogLevel ll, String facility) { return isEnabled(new LogRecord(null, null, ll, facility, null, null)); } /** * Find out if we should pass this record down the chain. * * @param lr Log record to analyze. * * @return <code>true</code> if the filter configuration allows this * record to be passed to the log device further down the chain. */ public abstract boolean isEnabled(LogRecord lr); public final void setConfigurationRoot(String configurationRoot) { if ( configurationRoot != null ) { throw new IllegalStateException("You cannot reset the configuration root. Destroy this one and instantiate new."); } this.configurationRoot = configurationRoot; } public final String getConfigurationRoot() { return configurationRoot; } } |