⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 debuglog.h

📁 把html转成txt 把html转成txt
💻 H
字号:
//---------------------------------------------------------------------------

#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 + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -