Public Member Functions | Private Attributes

claw::file_logger Class Reference

This class write log messages in a file. More...

#include <log_stream.hpp>

Inheritance diagram for claw::file_logger:
claw::log_stream claw::concept::non_copyable

List of all members.

Public Member Functions

 file_logger (const std::string &filename)
 Constructor.
virtual ~file_logger ()
 Destructor.
virtual void write (const std::string &str)
 Write a string in the file.
virtual void flush ()
 Flush the stream.

Private Attributes

std::ofstream * m_file
 The file in which we write the messages.

Detailed Description

This class write log messages in a file.

Author:
Julien Jorge

Definition at line 80 of file log_stream.hpp.


Constructor & Destructor Documentation

claw::file_logger::file_logger ( const std::string &  filename  ) 

Constructor.

Definition at line 79 of file log_stream.cpp.

References m_file.

{
  m_file = new std::ofstream( filename.c_str() );
} // file_logger::file_logger()

claw::file_logger::~file_logger (  )  [virtual]

Destructor.

Definition at line 88 of file log_stream.cpp.

References m_file.

{
  delete m_file;
} // file_logger::~file_logger()


Member Function Documentation

void claw::file_logger::flush (  )  [virtual]

Flush the stream.

Definition at line 106 of file log_stream.cpp.

References m_file.

{
  m_file->flush();
} // file_logger::flush()

void claw::file_logger::write ( const std::string &  str  )  [virtual]

Write a string in the file.

Definition at line 97 of file log_stream.cpp.

{
  (*m_file) << str;
} // file_logger::write()


Member Data Documentation

std::ofstream* claw::file_logger::m_file [private]

The file in which we write the messages.

Definition at line 93 of file log_stream.hpp.

Referenced by file_logger(), flush(), and ~file_logger().


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