cAudio 2.3.0
3d Audio Engine
Loading...
Searching...
No Matches
cLogger.h
1// Copyright (c) 2008-2011 Raynaldo (Wildicv) Rivera, Joshua (Dark_Kilauea) Jones, Murat (wolfmanfx) Sari
2// This file is part of the "cAudio Engine"
3// For conditions of distribution and use, see copyright notice in cAudio.h
4
5#pragma once
6
7#include <stdarg.h>
8#include "cMutex.h"
9#include "ILogger.h"
10#include "cSTLAllocator.h"
11#include "cAudioString.h"
12
13namespace cAudio
14{
15 class cLogger : public ILogger
16 {
17 public:
18 cLogger();
19 virtual ~cLogger() { }
20
21 virtual void logCritical( const char* sender, const char *msg, ... );
22 virtual void logError( const char* sender, const char *msg, ... );
23 virtual void logWarning( const char* sender, const char *msg, ... );
24 virtual void logInfo( const char* sender, const char *msg, ... );
25 virtual void logDebug( const char* sender, const char *msg, ... );
26
27 virtual const LogLevel& getLogLevel() const { return MinLogLevel; }
28 virtual void setLogLevel( const LogLevel& logLevel );
29
30 virtual bool registerLogReceiver(ILogReceiver* receiver, const char* name);
31 virtual void unRegisterLogReceiver(const char* name);
32 virtual bool isLogReceiverRegistered(const char* name);
33 virtual ILogReceiver* getLogReceiver(const char* name);
34
35 protected:
36 void broadcastMessage( LogLevel level, const char* sender, const char* msg, va_list args );
37
38 cAudioMutex Mutex;
39 unsigned long StartTime;
40 char TempTextBuf[2048];
41 LogLevel MinLogLevel;
42 cAudioMap<cAudioString, ILogReceiver*>::Type Receivers;
44 private:
45 };
46};
Interface for receiving log messages and relaying them to some kind of output device or stream.
Definition: ILogReceiver.h:33
Interface for all logging operations in cAudio.
Definition: ILogger.h:14
virtual bool isLogReceiverRegistered(const char *name)
Returns whether an log receiver is currently registered.
Definition: cLogger.cpp:117
virtual void logWarning(const char *sender, const char *msg,...)
Used to log a warning to the logging system.
Definition: cLogger.cpp:43
virtual void logDebug(const char *sender, const char *msg,...)
Used to log a debug message to the logging system.
Definition: cLogger.cpp:67
virtual bool registerLogReceiver(ILogReceiver *receiver, const char *name)
Register Log Receiver.
Definition: cLogger.cpp:96
virtual const LogLevel & getLogLevel() const
Returns the minimum log level that will be sent to the log receivers.
Definition: cLogger.h:27
virtual void logInfo(const char *sender, const char *msg,...)
Used to log an informational message to the logging system.
Definition: cLogger.cpp:55
virtual void unRegisterLogReceiver(const char *name)
Unregister a Log Receiver.
Definition: cLogger.cpp:105
virtual void logError(const char *sender, const char *msg,...)
Used to log an error message to the logging system.
Definition: cLogger.cpp:31
virtual void logCritical(const char *sender, const char *msg,...)
Used to log a critical error message to the logging system.
Definition: cLogger.cpp:19
virtual void setLogLevel(const LogLevel &logLevel)
Sets the minimum log level that the engine will send to log receivers.
Definition: cLogger.cpp:79
virtual ILogReceiver * getLogReceiver(const char *name)
Returns a registered log receiver.
Definition: cLogger.cpp:127
Main namespace for the entire cAudio library.
Definition: cAudioCapture.h:16
LogLevel
Enum of all supported log levels in cAudio.
Definition: ILogReceiver.h:11