This class write log messages in a file. More...
#include <log_stream.hpp>
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. |
This class write log messages in a file.
Definition at line 80 of file log_stream.hpp.
claw::file_logger::file_logger | ( | const std::string & | filename | ) |
Constructor.
Definition at line 79 of file log_stream.cpp.
References m_file.
00080 { 00081 m_file = new std::ofstream( filename.c_str() ); 00082 } // file_logger::file_logger()
claw::file_logger::~file_logger | ( | ) | [virtual] |
Destructor.
Definition at line 88 of file log_stream.cpp.
References m_file.
00089 { 00090 delete m_file; 00091 } // file_logger::~file_logger()
void claw::file_logger::flush | ( | ) | [virtual] |
Flush the stream.
Reimplemented from claw::log_stream.
Definition at line 106 of file log_stream.cpp.
References m_file.
00107 { 00108 m_file->flush(); 00109 } // file_logger::flush()
void claw::file_logger::write | ( | const std::string & | str | ) | [virtual] |
Write a string in the file.
Implements claw::log_stream.
Definition at line 97 of file log_stream.cpp.
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().