mirror of
https://github.com/debauchee/barrier.git
synced 2026-05-10 00:11:43 +08:00
Some work toward Issue 27 and Issue 319
This commit is contained in:
@@ -14,6 +14,7 @@
|
||||
|
||||
#include "LogOutputters.h"
|
||||
#include "CArch.h"
|
||||
#include "TMethodJob.h"
|
||||
|
||||
#include <fstream>
|
||||
//
|
||||
@@ -54,12 +55,6 @@ CStopLogOutputter::write(ELevel, const char*)
|
||||
return false;
|
||||
}
|
||||
|
||||
const char*
|
||||
CStopLogOutputter::getNewline() const
|
||||
{
|
||||
return "";
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// CConsoleLogOutputter
|
||||
@@ -67,12 +62,10 @@ CStopLogOutputter::getNewline() const
|
||||
|
||||
CConsoleLogOutputter::CConsoleLogOutputter()
|
||||
{
|
||||
// do nothing
|
||||
}
|
||||
|
||||
CConsoleLogOutputter::~CConsoleLogOutputter()
|
||||
{
|
||||
// do nothing
|
||||
}
|
||||
|
||||
void
|
||||
@@ -94,16 +87,16 @@ CConsoleLogOutputter::show(bool showIfEmpty)
|
||||
}
|
||||
|
||||
bool
|
||||
CConsoleLogOutputter::write(ELevel, const char* msg)
|
||||
CConsoleLogOutputter::write(ELevel level, const char* msg)
|
||||
{
|
||||
ARCH->writeConsole(msg);
|
||||
return true;
|
||||
return true; // wtf?
|
||||
}
|
||||
|
||||
const char*
|
||||
CConsoleLogOutputter::getNewline() const
|
||||
void
|
||||
CConsoleLogOutputter::flush()
|
||||
{
|
||||
return ARCH->getNewlineForConsole();
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -170,13 +163,6 @@ CSystemLogOutputter::write(ELevel level, const char* msg)
|
||||
return true;
|
||||
}
|
||||
|
||||
const char*
|
||||
CSystemLogOutputter::getNewline() const
|
||||
{
|
||||
return "";
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// CSystemLogger
|
||||
//
|
||||
@@ -261,12 +247,6 @@ CBufferedLogOutputter::write(ELevel, const char* message)
|
||||
return true;
|
||||
}
|
||||
|
||||
const char*
|
||||
CBufferedLogOutputter::getNewline() const
|
||||
{
|
||||
return "";
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// CFileLogOutputter
|
||||
@@ -287,17 +267,11 @@ CFileLogOutputter::~CFileLogOutputter()
|
||||
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;
|
||||
m_handle << message << std::endl;
|
||||
|
||||
// write buffer to file
|
||||
m_handle.flush();
|
||||
|
||||
Reference in New Issue
Block a user