casa  $Rev:20696$
Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes
casa::TSLogSink Class Reference

Save distributed log messages. More...

#include <TSLogSink.h>

Inheritance diagram for casa::TSLogSink:
casa::LogSinkInterface

List of all members.

Public Member Functions

 TSLogSink ()
 Create an empty sink without a filter.
 TSLogSink (LogMessage::Priority filter)
 Create an empty sink with the given filter.
 TSLogSink (const LogFilterInterface &filter)
 TSLogSink (const TSLogSink &other)
 Copy constructor (copy semantics).
TSLogSinkoperator= (const TSLogSink &other)
 Assignment (copy semantics).
virtual ~TSLogSink ()
virtual Bool postLocally (const LogMessage &message)
 If the message passes the filter, write it.
String id () const
 Returns the id of the LogSink in use..\.
const LogFilterInterfacefilter () const
 Get/set the filter.
LogSinkInterfacefilter (const LogFilterInterface &newfilter)
void cerrToo (Bool)
 Write to cerr too.
void setLogSink (String logname="")

Static Public Member Functions

static String localId ()
 Returns the id for this class..\.

Private Member Functions

void copy_other (const TSLogSink &other)
 Avoid duplicating code in copy ctor and assignment operator.

Private Attributes

LogSinkInterfacelogsink
Bool send2cerr
std::ofstream * logfile

Detailed Description

Save distributed log messages.

Intended use:

Public interface

Review Status

Reviewed By:
UNKNOWN
Date Reviewed:
before2004/08/25
Test programs:
tLogging
Demo programs:
dLogging

Prerequisite

Synopsis

This class posts messages which pass the filter to a distributed logger.

Example

See (see (file="Logging.h"))Logging.h .

Motivation

For a distributed systems log messages.

Definition at line 77 of file TSLogSink.h.


Constructor & Destructor Documentation

casa::TSLogSink::TSLogSink ( )

Create an empty sink without a filter.

casa::TSLogSink::TSLogSink ( LogMessage::Priority  filter) [explicit]

Create an empty sink with the given filter.

casa::TSLogSink::TSLogSink ( const LogFilterInterface filter) [explicit]
casa::TSLogSink::TSLogSink ( const TSLogSink other)

Copy constructor (copy semantics).

virtual casa::TSLogSink::~TSLogSink ( ) [virtual]

Member Function Documentation

void casa::TSLogSink::cerrToo ( Bool  cerr2) [virtual]

Write to cerr too.

Reimplemented from casa::LogSinkInterface.

void casa::TSLogSink::copy_other ( const TSLogSink other) [private]

Avoid duplicating code in copy ctor and assignment operator.

const LogFilterInterface& casa::TSLogSink::filter ( ) const [virtual]

Get/set the filter.

Reimplemented from casa::LogSinkInterface.

LogSinkInterface& casa::TSLogSink::filter ( const LogFilterInterface newfilter) [virtual]

Reimplemented from casa::LogSinkInterface.

String casa::TSLogSink::id ( ) const [virtual]

Returns the id of the LogSink in use..\.

Implements casa::LogSinkInterface.

static String casa::TSLogSink::localId ( ) [static]

Returns the id for this class..\.

Reimplemented from casa::LogSinkInterface.

TSLogSink& casa::TSLogSink::operator= ( const TSLogSink other)

Assignment (copy semantics).

virtual Bool casa::TSLogSink::postLocally ( const LogMessage message) [virtual]

If the message passes the filter, write it.

Implements casa::LogSinkInterface.

void casa::TSLogSink::setLogSink ( String  logname = "")

Member Data Documentation

std::ofstream* casa::TSLogSink::logfile [private]

Definition at line 117 of file TSLogSink.h.

Definition at line 115 of file TSLogSink.h.

Definition at line 116 of file TSLogSink.h.


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines