123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103 |
- #pragma once
- #include <string>
- #define __LOG__NullLog__
- //-----------------------------------------------------------------------------
- // 定义一个全空的日志类, 某些模块可能不想要任何日志
- //-----------------------------------------------------------------------------
- namespace ECOM
- {
- namespace NullLog
- {
- // 无格式输出, 直接刷盘
- inline void Flush (const char * str) {}
- inline void Flush (const char * str, int) {}
- inline void NewLine () {}
- template <typename... Args>
- void Log (const char * format, Args && ... args)
- {
- }
- template <typename... Args>
- void Force (const char * format, Args && ... args)
- {
- }
- template <typename... Args>
- void Info (const char * format, Args && ... args)
- {
- }
- template <typename... Args>
- void Notice (const char * format, Args && ... args)
- {
- }
- template <typename... Args>
- void Warning (const char * format, Args && ... args)
- {
- }
- template <typename... Args>
- void Warn (const char * format, Args && ... args)
- {
- }
- template <typename... Args>
- void Error (const char * format, Args && ... args)
- {
- }
- template <typename... Args>
- void Fatal (const char * format, Args && ... args)
- {
- }
- template <typename... Args>
- void Log (const std::string & format, Args && ... args)
- {
- }
- template <typename... Args>
- void Info (const std::string & format, Args && ... args)
- {
- }
- template <typename... Args>
- void Warning (const std::string & format, Args && ... args)
- {
- }
- template <typename... Args>
- void Error (const std::string & format, Args && ... args)
- {
- }
- template <typename... Args>
- void Fatal (const std::string & format, Args && ... args)
- {
- }
- static std::string ErrorCodeToString (DWORD errorCode)
- {
- return std::string ();
- }
- static void Close ()
- {
- }
- }
- }
- namespace mLog = ECOM::NullLog;
|