Package adams.flow.standalone.logevent
Class LevelFilter
- java.lang.Object
-
- adams.core.logging.LoggingObject
-
- adams.core.logging.CustomLoggingLevelObject
-
- adams.core.option.AbstractOptionHandler
-
- adams.flow.standalone.logevent.AbstractLogRecordFilter
-
- adams.flow.standalone.logevent.LevelFilter
-
- All Implemented Interfaces:
Destroyable,GlobalInfoSupporter,LoggingLevelHandler,LoggingSupporter,OptionHandler,SizeOfHandler,Serializable
public class LevelFilter extends AbstractLogRecordFilter
Filters records based on their logging level, i.e., if the fall in the specified min/max (inclusive).
Valid options are:
-logging-level <OFF|SEVERE|WARNING|INFO|CONFIG|FINE|FINER|FINEST> (property: loggingLevel) The logging level for outputting errors and debugging output. default: WARNING
-minimum <OFF|SEVERE|WARNING|INFO|CONFIG|FINE|FINER|FINEST> (property: minimum) The minimum level to accept. default: SEVERE
-maximum <OFF|SEVERE|WARNING|INFO|CONFIG|FINE|FINER|FINEST> (property: maximum) The maximum level to accept. default: FINEST
- Version:
- $Revision$
- Author:
- fracpete (fracpete at waikato dot ac dot nz)
- See Also:
LoggingHelper#levelToOutputType(java.util.logging.Level), Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected LoggingLevelm_Maximumthe maximum level to accept.protected LoggingLevelm_Minimumthe minimum level to accept.-
Fields inherited from class adams.core.option.AbstractOptionHandler
m_OptionManager
-
Fields inherited from class adams.core.logging.LoggingObject
m_Logger, m_LoggingIsEnabled, m_LoggingLevel
-
-
Constructor Summary
Constructors Constructor Description LevelFilter()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanacceptRecord(LogRecord record)Returns whether the log record is accepted or not for further processing.voiddefineOptions()Adds options to the internal list of options.LoggingLevelgetMaximum()Returns the maximum level of records to accept.LoggingLevelgetMinimum()Returns the minimum level of records to accept.StringglobalInfo()Returns a string describing the object.StringmaximumTipText()Returns the tip text for this property.StringminimumTipText()Returns the tip text for this property.voidsetMaximum(LoggingLevel value)Sets the maximum level of records to accept.voidsetMinimum(LoggingLevel value)Sets the minimum level of records to accept.-
Methods inherited from class adams.core.option.AbstractOptionHandler
cleanUpOptions, destroy, finishInit, getDefaultLoggingLevel, getOptionManager, initialize, loggingLevelTipText, newOptionManager, reset, setLoggingLevel, toCommandLine, toString
-
Methods inherited from class adams.core.logging.LoggingObject
configureLogger, getLogger, getLoggingLevel, initializeLogging, isLoggingEnabled, sizeOf
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface adams.core.logging.LoggingLevelHandler
getLoggingLevel
-
-
-
-
Field Detail
-
m_Minimum
protected LoggingLevel m_Minimum
the minimum level to accept.
-
m_Maximum
protected LoggingLevel m_Maximum
the maximum level to accept.
-
-
Method Detail
-
globalInfo
public String globalInfo()
Returns a string describing the object.- Specified by:
globalInfoin interfaceGlobalInfoSupporter- Specified by:
globalInfoin classAbstractOptionHandler- Returns:
- a description suitable for displaying in the gui
-
defineOptions
public void defineOptions()
Adds options to the internal list of options.- Specified by:
defineOptionsin interfaceOptionHandler- Overrides:
defineOptionsin classAbstractOptionHandler
-
setMinimum
public void setMinimum(LoggingLevel value)
Sets the minimum level of records to accept.- Parameters:
value- the level
-
getMinimum
public LoggingLevel getMinimum()
Returns the minimum level of records to accept.- Returns:
- the level
-
minimumTipText
public String minimumTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
setMaximum
public void setMaximum(LoggingLevel value)
Sets the maximum level of records to accept.- Parameters:
value- the level
-
getMaximum
public LoggingLevel getMaximum()
Returns the maximum level of records to accept.- Returns:
- the level
-
maximumTipText
public String maximumTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
acceptRecord
public boolean acceptRecord(LogRecord record)
Returns whether the log record is accepted or not for further processing.- Specified by:
acceptRecordin classAbstractLogRecordFilter- Parameters:
record- the record to check- Returns:
- true if the record's level falls in the specified min/max
-
-