Added some missing files. Included is a default log receiver that pipes the information to the standard out stream (Console).

This commit is contained in:
Joshua Jones 2009-11-20 03:42:20 +00:00
parent 6b3e9c5a9d
commit 0df02507dc
3 changed files with 68 additions and 0 deletions

View File

@ -0,0 +1,19 @@
#ifndef CCONSOLELOGRECEIVER_H_INCLUDED
#define CCONSOLELOGRECEIVER_H_INCLUDED
#include "../include/ILogReceiver.h"
namespace cAudio
{
class cConsoleLogReceiver : public ILogReceiver
{
public:
virtual bool OnLogMessage(const char* sender, const char* message, LogLevel level, float time);
private:
};
};
#endif //! CCONSOLELOGRECEIVER_H_INCLUDED

View File

@ -0,0 +1,14 @@
#include "../Headers/cConsoleLogReceiver.h"
#include <iostream>
namespace cAudio
{
bool cConsoleLogReceiver::OnLogMessage(const char* sender, const char* message, LogLevel level, float time)
{
//std::cout << time << " " << sender << ": [" << LogLevelStrings[level] << "] " << message << std::endl;
std::cout << "[" << LogLevelStrings[level] << "] " << message << std::endl;
return true;
}
};

35
include/ILogReceiver.h Normal file
View File

@ -0,0 +1,35 @@
#ifndef ILOGRECEIVER_H_INCLUDED
#define ILOGRECEIVER_H_INCLUDED
namespace cAudio
{
enum LogLevel
{
ELL_DEBUG,
ELL_INFO,
ELL_WARNING,
ELL_ERROR,
ELL_CRITICAL,
ELL_COUNT
};
const char* const LogLevelStrings[] =
{
"Debug",
"Information",
"Warning",
"Error",
"Critical",
0
};
class ILogReceiver
{
public:
ILogReceiver() { }
~ILogReceiver() { }
virtual bool OnLogMessage(const char* sender, const char* message, LogLevel level, float time) = 0;
};
};
#endif //! ILOGRECEIVER_H_INCLUDED