cLogger.h

00001 // Copyright (c) 2008-2010 Raynaldo (Wildicv) Rivera, Joshua (Dark_Kilauea) Jones
00002 // This file is part of the "cAudio Engine"
00003 // For conditions of distribution and use, see copyright notice in cAudio.h
00004 
00005 #ifndef CLOGGER_H_INCLUDED
00006 #define CLOGGER_H_INCLUDED
00007 
00008 #include <map>
00009 #include <string>
00010 #include <stdarg.h>
00011 
00012 #include "../include/ILogger.h"
00013 #include "../Headers/cMutex.h"
00014 
00015 namespace cAudio
00016 {
00017         class cLogger : public ILogger
00018     {
00019     public:
00020                 cLogger();
00021                 virtual ~cLogger() { }
00022 
00023                 virtual void logCritical( const char* sender, const char *msg, ... );
00024                 virtual void logError( const char* sender, const char *msg, ... );
00025                 virtual void logWarning( const char* sender, const char *msg, ... );
00026                 virtual void logInfo( const char* sender, const char *msg, ... );
00027                 virtual void logDebug( const char* sender, const char *msg, ... );
00028 
00029                 virtual const LogLevel& getLogLevel() const { return MinLogLevel; }
00030                 virtual void setLogLevel( const LogLevel& logLevel );
00031 
00032                 virtual bool registerLogReceiver(ILogReceiver* receiver, const char* name);
00033                 virtual void unRegisterLogReceiver(const char* name);
00034                 virtual bool isLogReceiverRegistered(const char* name);
00035                 virtual ILogReceiver* getLogReceiver(const char* name);
00036 
00037         protected:
00038                 void broadcastMessage( LogLevel level, const char* sender, const char* msg, va_list args );
00039 
00040                 cAudioMutex Mutex;
00041                 unsigned long StartTime;
00042                 char TempTextBuf[2048];
00043                 LogLevel MinLogLevel;
00044                 std::map<std::string, ILogReceiver*> Receivers;
00045         private:
00046     };
00047 };
00048 #endif 
 All Classes Namespaces Functions Variables Enumerations

Generated on Sat Feb 20 22:55:07 2010 for cAudio by  doxygen 1.6.2