2010-02-09 05:18:39 +01:00
|
|
|
// Copyright (c) 2008-2010 Raynaldo (Wildicv) Rivera, Joshua (Dark_Kilauea) Jones
|
|
|
|
// This file is part of the "cAudio Engine"
|
|
|
|
// For conditions of distribution and use, see copyright notice in cAudio.h
|
|
|
|
|
2009-11-20 04:39:56 +01:00
|
|
|
#ifndef CLOGGER_H_INCLUDED
|
2009-09-12 07:59:28 +02:00
|
|
|
#define CLOGGER_H_INCLUDED
|
2009-11-20 04:39:56 +01:00
|
|
|
|
|
|
|
#include <stdarg.h>
|
2009-09-12 07:59:28 +02:00
|
|
|
|
2009-12-01 02:41:15 +01:00
|
|
|
#include "../include/ILogger.h"
|
|
|
|
#include "../Headers/cMutex.h"
|
2010-03-08 05:56:56 +01:00
|
|
|
#include "../Headers/cSTLAllocator.h"
|
2009-12-01 02:41:15 +01:00
|
|
|
|
2009-11-20 04:39:56 +01:00
|
|
|
namespace cAudio
|
|
|
|
{
|
|
|
|
class cLogger : public ILogger
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
cLogger();
|
|
|
|
virtual ~cLogger() { }
|
2009-09-12 07:59:28 +02:00
|
|
|
|
2009-11-20 04:39:56 +01:00
|
|
|
virtual void logCritical( const char* sender, const char *msg, ... );
|
|
|
|
virtual void logError( const char* sender, const char *msg, ... );
|
|
|
|
virtual void logWarning( const char* sender, const char *msg, ... );
|
|
|
|
virtual void logInfo( const char* sender, const char *msg, ... );
|
|
|
|
virtual void logDebug( const char* sender, const char *msg, ... );
|
2009-09-12 07:59:28 +02:00
|
|
|
|
2009-11-20 04:39:56 +01:00
|
|
|
virtual const LogLevel& getLogLevel() const { return MinLogLevel; }
|
|
|
|
virtual void setLogLevel( const LogLevel& logLevel );
|
2009-09-12 07:59:28 +02:00
|
|
|
|
2009-12-01 02:41:15 +01:00
|
|
|
virtual bool registerLogReceiver(ILogReceiver* receiver, const char* name);
|
|
|
|
virtual void unRegisterLogReceiver(const char* name);
|
|
|
|
virtual bool isLogReceiverRegistered(const char* name);
|
|
|
|
virtual ILogReceiver* getLogReceiver(const char* name);
|
2009-11-20 04:39:56 +01:00
|
|
|
|
|
|
|
protected:
|
|
|
|
void broadcastMessage( LogLevel level, const char* sender, const char* msg, va_list args );
|
2009-09-12 07:59:28 +02:00
|
|
|
|
|
|
|
cAudioMutex Mutex;
|
2009-11-20 04:39:56 +01:00
|
|
|
unsigned long StartTime;
|
|
|
|
char TempTextBuf[2048];
|
|
|
|
LogLevel MinLogLevel;
|
2010-03-14 23:58:03 +01:00
|
|
|
cAudioMap<cAudioString, ILogReceiver*>::Type Receivers;
|
|
|
|
typedef cAudioMap<cAudioString, ILogReceiver*>::Type::iterator ReceiversIterator;
|
2009-11-20 04:39:56 +01:00
|
|
|
private:
|
|
|
|
};
|
2009-09-12 07:59:28 +02:00
|
|
|
};
|
2009-11-20 04:39:56 +01:00
|
|
|
#endif //! CLOGGER_H_INCLUDED
|