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.
{ 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()
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()
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().