Arc::LogStream Class Reference

A class for logging to ostreams. More...

#include <Logger.h>

Inheritance diagram for Arc::LogStream:
Arc::LogDestination

Public Member Functions

 LogStream (std::ostream &destination)
 LogStream (std::ostream &destination, const std::string &locale)
virtual void log (const LogMessage &message)

Detailed Description

A class for logging to ostreams.

This class is used for logging to ostreams (cout, cerr, files). It provides synchronization in order to prevent different LogMessages to appear mixed with each other in the stream. In order not to break the synchronization, LogStreams should never be copied. Therefore the copy constructor and assignment operator are private. Furthermore, it is important to keep a LogStream object as long as the Logger to which it has been registered.


Constructor & Destructor Documentation

Arc::LogStream::LogStream ( std::ostream &  destination  ) 

Creates a LogStream connected to an ostream.

Creates a LogStream connected to the specified ostream. In order not to break synchronization, it is important not to connect more than one LogStream object to a certain stream.

Parameters:
destination The ostream to which to erite LogMessages.
Arc::LogStream::LogStream ( std::ostream &  destination,
const std::string &  locale 
)

Creates a LogStream connected to an ostream.

Creates a LogStream connected to the specified ostream. The output will be localised to the specified locale.


Member Function Documentation

virtual void Arc::LogStream::log ( const LogMessage message  )  [virtual]

Writes a LogMessage to the stream.

This method writes a LogMessage to the ostream that is connected to this LogStream object. It is synchronized so that not more than one LogMessage can be written at a time.

Parameters:
message The LogMessage to write.

Implements Arc::LogDestination.


The documentation for this class was generated from the following file:
Generated on Wed Jun 27 11:54:21 2012 for Hosting Environment (Daemon) by  doxygen 1.6.3