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:
parent
6b3e9c5a9d
commit
0df02507dc
|
@ -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
|
||||
|
|
@ -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;
|
||||
}
|
||||
};
|
||||
|
||||
|
|
@ -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
|
Loading…
Reference in New Issue