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: casa-feedback@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#ifndef CASA_NULLLOGSINK_H
27#define CASA_NULLLOGSINK_H
28
29#include <casacore/casa/aips.h>
30#include <casacore/casa/Logging/LogSinkInterface.h>
31
32namespace casacore { //# NAMESPACE CASACORE - BEGIN
33
34// <summary>
35// Throw away all messages.
36// </summary>
37
38// <use visibility=local>
39
40// <reviewed reviewer="wbrouw" date="1996/08/21" tests="tLogging.cc" demos="dLogging.cc">
41// </reviewed>
42
43// <prerequisite>
44// <li> <linkto class=LogSinkInterface>LogSinkInterface</linkto>
45// </prerequisite>
46//
47// <etymology>
48// Null as in "empty" or "/dev/null".
49// </etymology>
50//
51// <synopsis>
52// <src>NullLogSink</src> is a trivial
53// <linkto class=LogSinkInterface>LogSinkInterface</linkto> which merely throws
54// away all its messages. It is not intended to be used directly, rather it
55// should be used through <linkto class=LogSink>LogSink</linkto>.
56// </synopsis>
57//
58// <example>
59// See <linkto file="Logging.h">Logging.h</linkto>.
60// </example>
61//
62// <motivation>
63// For testing, or to prevent multiply logging (local and global) to
64// <src>cerr</src> (say).
65// </motivation>
66//
67// <todo asof="1996/07/24">
68// <li> Nothing known.
69// </todo>
70
72public:
76
77 NullLogSink(const NullLogSink &other);
79
81
82 // Always throws the message away, but it does return <src>True</src> or
83 // <src>False</src> depending on whether or not <src>message</src> passes
84 // the filter.
85 virtual Bool postLocally(const LogMessage &message);
86
87 // Returns the id for this class...
88 static String localId( );
89 // Returns the id of the LogSink in use...
90 String id( ) const;
91};
92
93
94} //# NAMESPACE CASACORE - END
95
96#endif
97
98
Priority
An "importance" which is assigned to each LogMessage.
Definition LogMessage.h:102
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:223
this file contains all the compiler specific defines
Definition mainpage.dox:28
bool Bool
Define the standard types used by Casacore.
Definition aipstype.h:40