mirror of
https://github.com/debauchee/barrier.git
synced 2025-06-21 20:17:03 +02:00
Changes from mercurial repository.
This commit is contained in:
parent
44bb32f476
commit
98c68897d8
135 changed files with 2686 additions and 26965 deletions
|
@ -15,6 +15,7 @@
|
|||
#include "LogOutputters.h"
|
||||
#include "CArch.h"
|
||||
|
||||
#include <fstream>
|
||||
//
|
||||
// CStopLogOutputter
|
||||
//
|
||||
|
@ -265,3 +266,51 @@ CBufferedLogOutputter::getNewline() const
|
|||
{
|
||||
return "";
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// CFileLogOutputter
|
||||
//
|
||||
|
||||
CFileLogOutputter::CFileLogOutputter(const char * logFile)
|
||||
{
|
||||
assert(logFile != NULL);
|
||||
|
||||
m_handle.open(logFile, std::fstream::app);
|
||||
// open file handle
|
||||
}
|
||||
|
||||
CFileLogOutputter::~CFileLogOutputter()
|
||||
{
|
||||
// close file handle
|
||||
if (m_handle.is_open())
|
||||
m_handle.close();
|
||||
}
|
||||
|
||||
const char*
|
||||
CFileLogOutputter::getNewline() const
|
||||
{
|
||||
return "\n";
|
||||
}
|
||||
|
||||
bool
|
||||
CFileLogOutputter::write(ILogOutputter::ELevel level, const char *message)
|
||||
{
|
||||
if (m_handle.is_open() && m_handle.fail() != true) {
|
||||
m_handle << message;
|
||||
|
||||
// write buffer to file
|
||||
m_handle.flush();
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
void
|
||||
CFileLogOutputter::open(const char *title) {}
|
||||
|
||||
void
|
||||
CFileLogOutputter::close() {}
|
||||
|
||||
void
|
||||
CFileLogOutputter::show(bool showIfEmpty) {}
|
Loading…
Add table
Add a link
Reference in a new issue