debuglog.h
来自「把html转成txt 把html转成txt」· C头文件 代码 · 共 48 行
H
48 行
//---------------------------------------------------------------------------
#ifndef debugH
#define debugH
//---------------------------------------------------------------------------
#include <ostream>
#include <sstream>
#include <map>
// Globally defined debug logging constant ENABLE_LOG_DEBUG
namespace DoxEngine
{
enum LogLevel
{
LOG_DEBUG,
LOG_INFO,
LOG_WARNING,
LOG_ERROR
};
typedef std::map<LogLevel, std::ostream*> LevelToStreamMap;
class DebugLog
{
public:
DebugLog();
DebugLog(const DebugLog &rhs);
~DebugLog();
DebugLog& operator=(const DebugLog &rhs);
// Note: DebugLog does not take ownership or copy of stream
void SetStream(const LogLevel level, std::ostream &stream);
std::ostream& GetStream(const LogLevel level);
std::ostream& operator[](const LogLevel level);
private:
LevelToStreamMap map;
std::ostream nullstream;
};
}
#define DEBUG_ID __FILE__ << __LINE__
#endif
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?