casacore
Loading...
Searching...
No Matches
NullLogSink.h
Go to the documentation of this file.
1//# NullLogSink.h: Throw away all messages.
2//# Copyright (C) 1996,2003
3//# Associated Universities, Inc. Washington DC, USA.
4//#
5//# This library is free software; you can redistribute it and/or modify it
6//# under the terms of the GNU Library General Public License as published by
7//# the Free Software Foundation; either version 2 of the License, or (at your
8//# option) any later version.
9//#
10//# This library is distributed in the hope that it will be useful, but WITHOUT
11//# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12//# FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
13//# License for more details.
14//#
15//# You should have received a copy of the GNU Library General Public License
16//# along with this library; if not, write to the Free Software Foundation,
17//# Inc., 675 Massachusetts Ave, Cambridge, MA 02139, USA.
18//#
19//# Correspondence concerning AIPS++ should be addressed as follows:
20//# Internet email: aips2-request@nrao.edu.
21//# Postal address: AIPS++ Project Office
22//# National Radio Astronomy Observatory
23//# 520 Edgemont Road
24//# Charlottesville, VA 22903-2475 USA
25//#
26//#
27//# $Id$
28
29#ifndef CASA_NULLLOGSINK_H
30#define CASA_NULLLOGSINK_H
31
32#include <casacore/casa/aips.h>
33#include <casacore/casa/Logging/LogSinkInterface.h>
34
35namespace casacore { //# NAMESPACE CASACORE - BEGIN
36
37// <summary>
38// Throw away all messages.
39// </summary>
40
41// <use visibility=local>
42
43// <reviewed reviewer="wbrouw" date="1996/08/21" tests="tLogging.cc" demos="dLogging.cc">
44// </reviewed>
45
46// <prerequisite>
47// <li> <linkto class=LogSinkInterface>LogSinkInterface</linkto>
48// </prerequisite>
49//
50// <etymology>
51// Null as in "empty" or "/dev/null".
52// </etymology>
53//
54// <synopsis>
55// <src>NullLogSink</src> is a trivial
56// <linkto class=LogSinkInterface>LogSinkInterface</linkto> which merely throws
57// away all its messages. It is not intended to be used directly, rather it
58// should be used through <linkto class=LogSink>LogSink</linkto>.
59// </synopsis>
60//
61// <example>
62// See <linkto file="Logging.h">Logging.h</linkto>.
63// </example>
64//
65// <motivation>
66// For testing, or to prevent multiply logging (local and global) to
67// <src>cerr</src> (say).
68// </motivation>
69//
70// <todo asof="1996/07/24">
71// <li> Nothing known.
72// </todo>
73
75public:
79
80 NullLogSink(const NullLogSink &other);
82
84
85 // Always throws the message away, but it does return <src>True</src> or
86 // <src>False</src> depending on whether or not <src>message</src> passes
87 // the filter.
88 virtual Bool postLocally(const LogMessage &message);
89
90 // Returns the id for this class...
91 static String localId( );
92 // Returns the id of the LogSink in use...
93 String id( ) const;
94};
95
96
97} //# NAMESPACE CASACORE - END
98
99#endif
100
101
Priority
An "importance" which is assigned to each LogMessage.
Definition LogMessage.h:105
virtual const LogFilterInterface & filter() const
Get/set the filter.
NullLogSink(LogMessage::Priority filter)
NullLogSink(const NullLogSink &other)
NullLogSink & operator=(const NullLogSink &other)
NullLogSink(const LogFilterInterface &filter)
String id() const
Returns the id of the LogSink in use...
virtual Bool postLocally(const LogMessage &message)
Always throws the message away, but it does return True or False depending on whether or not message ...
static String localId()
Returns the id for this class...
String: the storage and methods of handling collections of characters.
Definition String.h:225
this file contains all the compiler specific defines
Definition mainpage.dox:28
bool Bool
Define the standard types used by Casacore.
Definition aipstype.h:42