*
This commit is contained in:
@@ -0,0 +1,55 @@
|
||||
#ifndef NLog_h__
|
||||
#define NLog_h__
|
||||
|
||||
#include <sstream>
|
||||
#include <ostream>
|
||||
#include <strstream>
|
||||
#include <iostream>
|
||||
#include "../Types.h"
|
||||
|
||||
namespace LifeCore {
|
||||
enum LOG_LEVEL {
|
||||
LOG_WARNING,
|
||||
LOG_ERROR,
|
||||
LOG_INFO
|
||||
};
|
||||
|
||||
class ILogOutput {
|
||||
public:
|
||||
virtual bool Write(LOG_LEVEL level, const String& message) = 0;
|
||||
};
|
||||
|
||||
class NettleLog {
|
||||
public:
|
||||
std::stringstream* stm;
|
||||
//std::stringstream stm;
|
||||
NettleLog(LOG_LEVEL _level);
|
||||
~NettleLog();
|
||||
NettleLog& operator <<(int8 val);
|
||||
NettleLog& operator <<(int16 val);
|
||||
NettleLog& operator <<(uint16 val);
|
||||
NettleLog& operator <<(int32 val);
|
||||
NettleLog& operator <<(uint32 val);
|
||||
NettleLog& operator <<(uint64 val);
|
||||
NettleLog& operator <<(int64 val);
|
||||
NettleLog& operator <<(long val);
|
||||
NettleLog& operator <<(unsigned long val);
|
||||
NettleLog& operator <<(float val);
|
||||
NettleLog& operator <<(double val);
|
||||
NettleLog& operator <<(const String& val);
|
||||
NettleLog& operator <<(const char* val);
|
||||
NettleLog& operator <<(bool val);
|
||||
private:
|
||||
LOG_LEVEL level;
|
||||
|
||||
bool AbortOnError;
|
||||
bool bOutConsole;
|
||||
bool bOutFile;
|
||||
bool bOutInterface;
|
||||
};
|
||||
|
||||
inline NettleLog LogWarning() { return NettleLog(LOG_WARNING); }
|
||||
inline NettleLog LogError() { return NettleLog(LOG_ERROR); }
|
||||
inline NettleLog LogInfo() { return NettleLog(LOG_INFO); }
|
||||
}
|
||||
#endif // NLog_h__
|
||||
Reference in New Issue
Block a user