ShitEngine
基于 C++20 与 SDL3 的轻量级 2D 游戏引擎
载入中...
搜索中...
未找到
Log.h 文件参考
#include <memory>
#include <utility>
#include <cstdlib>
#include <spdlog/spdlog.h>
#include <spdlog/sinks/stdout_color_sinks.h>
#include <spdlog/fmt/ostr.h>
#include "Core.h"

浏览该文件的源代码.

class  Log
 日志封装类 更多...

命名空间

namespace  Shit

宏定义

#define ST_CORE_TRACE(...)
#define ST_CORE_DEBUG(...)
#define ST_CORE_INFO(...)
#define ST_CORE_WARN(...)
#define ST_CORE_ERROR(...)
#define ST_CORE_CRITICAL(...)
#define ST_TRACE(...)
#define ST_DEBUG(...)
#define ST_INFO(...)
#define ST_WARN(...)
#define ST_ERROR(...)
#define ST_CRITICAL(...)
#define ST_CORE_ASSERT(cond, msg)
#define ST_ASSERT(cond, msg)

宏定义说明

◆ ST_ASSERT

#define ST_ASSERT ( cond,
msg )
值:
do { if (!(cond)) { \
if (auto lg = ::Shit::Log::GetClientLogger()) \
lg->critical("ASSERT FAILED: {} -- {}", std::string(#cond), std::string(msg)); \
std::abort(); \
} } while (0)
static std::shared_ptr< spdlog::logger > & GetClientLogger()
定义 Log.h:40

◆ ST_CORE_ASSERT

#define ST_CORE_ASSERT ( cond,
msg )
值:
do { if (!(cond)) { \
if (auto lg = ::Shit::Log::GetCoreLogger()) \
lg->critical("ASSERT FAILED: {} -- {}", std::string(#cond), std::string(msg)); \
std::abort(); \
} } while (0)
static std::shared_ptr< spdlog::logger > & GetCoreLogger()
定义 Log.h:39

◆ ST_CORE_CRITICAL

#define ST_CORE_CRITICAL ( ...)
值:
do { if (auto lg = ::Shit::Log::GetCoreLogger()) lg->critical(__VA_ARGS__); } while (0)

◆ ST_CORE_DEBUG

#define ST_CORE_DEBUG ( ...)
值:
do { if (auto lg = ::Shit::Log::GetCoreLogger()) lg->debug(__VA_ARGS__); } while (0)

◆ ST_CORE_ERROR

#define ST_CORE_ERROR ( ...)
值:
do { if (auto lg = ::Shit::Log::GetCoreLogger()) lg->error(__VA_ARGS__); } while (0)

◆ ST_CORE_INFO

#define ST_CORE_INFO ( ...)
值:
do { if (auto lg = ::Shit::Log::GetCoreLogger()) lg->info(__VA_ARGS__); } while (0)

◆ ST_CORE_TRACE

#define ST_CORE_TRACE ( ...)
值:
do { if (auto lg = ::Shit::Log::GetCoreLogger()) lg->trace(__VA_ARGS__); } while (0)

◆ ST_CORE_WARN

#define ST_CORE_WARN ( ...)
值:
do { if (auto lg = ::Shit::Log::GetCoreLogger()) lg->warn(__VA_ARGS__); } while (0)

◆ ST_CRITICAL

#define ST_CRITICAL ( ...)
值:
do { if (auto lg = ::Shit::Log::GetClientLogger()) lg->critical(__VA_ARGS__); } while (0)

◆ ST_DEBUG

#define ST_DEBUG ( ...)
值:
do { if (auto lg = ::Shit::Log::GetClientLogger()) lg->debug(__VA_ARGS__); } while (0)

◆ ST_ERROR

#define ST_ERROR ( ...)
值:
do { if (auto lg = ::Shit::Log::GetClientLogger()) lg->error(__VA_ARGS__); } while (0)

◆ ST_INFO

#define ST_INFO ( ...)
值:
do { if (auto lg = ::Shit::Log::GetClientLogger()) lg->info(__VA_ARGS__); } while (0)

◆ ST_TRACE

#define ST_TRACE ( ...)
值:
do { if (auto lg = ::Shit::Log::GetClientLogger()) lg->trace(__VA_ARGS__); } while (0)

◆ ST_WARN

#define ST_WARN ( ...)
值:
do { if (auto lg = ::Shit::Log::GetClientLogger()) lg->warn(__VA_ARGS__); } while (0)