AnCH Framework  0.1
Another C++ Hack Framework
Public Member Functions | List of all members
anch::logger::ThreadSafeWriter Class Reference

#include <threadSafeWriter.hpp>

Inheritance diagram for anch::logger::ThreadSafeWriter:
Collaboration diagram for anch::logger::ThreadSafeWriter:

Public Member Functions

 ThreadSafeWriter (const std::string &fileName, const std::string &linePattern, int maxSize=0, int maxIndex=0)
 ThreadSafeWriter (std::ostream *output, const std::string &linePattern)
virtual ~ThreadSafeWriter ()
virtual void write (const std::string &category, const anch::logger::Level &level, const std::string &message)
- Public Member Functions inherited from anch::logger::Writer
 Writer (const std::string &fileName, const std::string &linePattern, int maxSize=0, int maxIndex=0)
 Writer (std::ostream *output, const std::string &linePattern)
virtual ~Writer ()

Additional Inherited Members

- Protected Member Functions inherited from anch::logger::Writer
bool rotate () const
void rotateFiles ()
- Protected Attributes inherited from anch::logger::Writer
std::ostream * _output
anch::logger::formatter::MessageFormatter _formatter

Detailed Description

File writer which manage conccurency access

Vincent Lachenal

Constructor & Destructor Documentation

ThreadSafeWriter::ThreadSafeWriter ( const std::string &  fileName,
const std::string &  linePattern,
int  maxSize = 0,
int  maxIndex = 0 

ThreadSafeWriter constructor

fileNameThe file name
linePatternThe line pattern
maxSizeThe file maximum size before file rotation
maxIndexThe maximum number of log files to keep
ThreadSafeWriter::ThreadSafeWriter ( std::ostream *  output,
const std::string &  linePattern 

ThreadSafeWriter constructor

outputThe output to use
linePatternThe line pattern
ThreadSafeWriter::~ThreadSafeWriter ( )

ThreadSafeWriter destructor

Member Function Documentation

void ThreadSafeWriter::write ( const std::string &  category,
const anch::logger::Level level,
const std::string &  message 

Write message in the file

categoryThe logger category
levelThe message level
messageMessage to write

Reimplemented from anch::logger::Writer.

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