Loading...
Searching...
No Matches
casacore::LogFilter Class Reference
casa package (libcasa_casa) » Logging_module

More...

`#include <LogFilter.h>`

## Public Member Functions

| LogFilter (LogMessage::Priority lowest=LogMessage::NORMAL)
| Construct a filter with the LOWEST priority that you want passed.
| LogFilter (const LogFilter &other)
| Copy other to this.
LogFilter & | operator= (const LogFilter &other)
virtual | ~LogFilter ()
virtual LogFilter * | clone () const
| Clone the object.
virtual Bool | pass (const LogMessage &message) const
| Return True if message passes this filter.
LogMessage::Priority | lowestPriority () const
| Return the lowest priority which will pass this filter.
Public Member Functions inherited from casacore::LogFilterInterface
| LogFilterInterface ()
| Construct a filter with the LOWEST priority that you want passed.
virtual | ~LogFilterInterface ()

## Private Attributes

LogMessage::Priority | lowest_p

## Detailed Description

Filter LogMessages on message priority.

### Intended use:

Public interface

### Review Status

Reviewed By:
  wbrouw
Date Reviewed:
  1996/08/21
Test programs:
  tLogging
Demo programs:
  dLogging

### Prerequisite

- LogMessage

### Etymology

Log[Message] Filter.

### Synopsis

The LogFilter class is used by the various log sink classes, typically accessed through LogSink, to decide whether a particular LogMessage should be accepted or rejected.

Simple filtering is based on the messages priority. In particular, you typically will choose to only pass messages greater than or equal to NORMAL in priority, but you might choose DEBUGGING to see all messages, or SEVERE to only see messages that report serious problems.

### Example

Suppose we wanted to change the global sink so that it prints all messages, including debugging messages:

LogFilter all(LogMessage::DEBUGGING);
LogSink::globalSink().filter(all);
casacore::LogFilter::LogFilter
LogFilter(LogMessage::Priority lowest=LogMessage::NORMAL)
Construct a filter with the LOWEST priority that you want passed.
casacore::LogMessage::DEBUGGING
@ DEBUGGING
Low priority - primarily used for findding problems or tracing execution.
Definition LogMessage.h:105
casacore::LogSinkInterface::filter
virtual const LogFilterInterface & filter() const
Get/set the filter.
casacore::LogSink::globalSink
static LogSinkInterface & globalSink()
Get/set the global sink or check if the global sink is null.
casacore::all
LatticeExprNode all(const LatticeExprNode &expr)

### Motivation

Definition at line 81 of file LogFilter.h.

## Constructor & Destructor Documentation

## LogFilter() [1/2]

casacore::LogFilter::LogFilter | ( | LogMessage::Priority | lowest = LogMessage::NORMAL | ) |

Construct a filter with the LOWEST priority that you want passed.

Thus DEBUGGING passes everything. Note that it is not possible to block SEVERE level messages, although you can use a NullLogSink which will have this effect.

References casacore::LogMessage::NORMAL.

Referenced by clone(), LogFilter(), and operator=().

## LogFilter() [2/2]

casacore::LogFilter::LogFilter | ( | const LogFilter & | other | ) |

Copy other to this.

References LogFilter().

## ~LogFilter()

virtual casacore::LogFilter::~LogFilter | ( |  | ) |

virtual

## Member Function Documentation

## clone()

virtual LogFilter * casacore::LogFilter::clone | ( |  | ) | const

virtual

Clone the object.

Implements casacore::LogFilterInterface.

References LogFilter().

## lowestPriority()

LogMessage::Priority casacore::LogFilter::lowestPriority | ( |  | ) | const

inline

Return the lowest priority which will pass this filter.

Definition at line 113 of file LogFilter.h.

References lowest_p.

## operator=()

LogFilter & casacore::LogFilter::operator= | ( | const LogFilter & | other | ) |

References LogFilter().

## pass()

virtual Bool casacore::LogFilter::pass | ( | const LogMessage & | message | ) | const

virtual

Return True if message passes this filter.

Implements casacore::LogFilterInterface.

## Member Data Documentation

## lowest_p

LogMessage::Priority casacore::LogFilter::lowest_p

private

Definition at line 109 of file LogFilter.h.

Referenced by lowestPriority().

The documentation for this class was generated from the following file:

- casa/Logging/LogFilter.h