You.i Engine
YiLogger.h File Reference
#include "utility/YiString.h"
#include <spdlog/common.h>
#include <spdlog/details/log_msg.h>
#include <spdlog/fmt/bundled/format.h>
#include <spdlog/fmt/bundled/printf.h>
#include <memory>
#include "logging/YiLogger.inl"

Go to the source code of this file.

Classes

class  CYILogger
 

Namespaces

 spdlog
 

Macros

#define PRETTYFUNCTION_PLATFORM   __PRETTY_FUNCTION__
 
#define YI_LOGGER_PRETTYFUNCTION   ""
 
#define _YI_LOG_CHECK_PARAMETERS(tag, message, ...)
 
#define _YI_LOG_AT_LEVEL(level, tag, message, ...)
 
#define YI_LOG_PURE(tag, message, ...)   _YI_LOG_AT_LEVEL(EYILogLevel::critical, (tag), message, ##__VA_ARGS__)
 
#define YI_LOGF(tag, message, ...)
 
#define YI_LOGE(tag, message, ...)   _YI_LOG_AT_LEVEL(EYILogLevel::err, (tag), message, ##__VA_ARGS__)
 
#define YI_LOGW(tag, message, ...)   _YI_LOG_AT_LEVEL(EYILogLevel::warn, (tag), message, ##__VA_ARGS__)
 
#define YI_LOGI(tag, message, ...)   _YI_LOG_AT_LEVEL(EYILogLevel::info, (tag), message, ##__VA_ARGS__)
 
#define YI_LOGD(tag, message, ...)   _YI_LOG_AT_LEVEL(EYILogLevel::debug, (tag), message, ##__VA_ARGS__)
 

Typedefs

using EYILogLevel = spdlog::level::level_enum
 
using CYILogMessage = spdlog::details::log_msg
 

Macro Definition Documentation

◆ _YI_LOG_AT_LEVEL

#define _YI_LOG_AT_LEVEL (   level,
  tag,
  message,
  ... 
)
Value:
do \
{ \
spdlog::logger *pLogger = youi_private::logging::GetDefaultLogger(level); \
if (pLogger) \
{ \
_YI_LOG_CHECK_PARAMETERS(tag, message, ##__VA_ARGS__) \
fmt::basic_memory_buffer<char> buffer; \
youi_private::logging::sprintfToBuffer(&buffer, message, ##__VA_ARGS__); \
youi_private::logging::Log(pLogger, spdlog::source_loc(youi_private::logging::ConvertTag(tag), __LINE__, YI_LOGGER_PRETTYFUNCTION), \
level, \
fmt::string_view(buffer.data(), buffer.size())); \
} \
} while ((void)0, false)
#define YI_LOGGER_PRETTYFUNCTION
Definition: YiLogger.h:33

◆ _YI_LOG_CHECK_PARAMETERS

#define _YI_LOG_CHECK_PARAMETERS (   tag,
  message,
  ... 
)

◆ PRETTYFUNCTION_PLATFORM

#define PRETTYFUNCTION_PLATFORM   __PRETTY_FUNCTION__

◆ YI_LOGGER_PRETTYFUNCTION

#define YI_LOGGER_PRETTYFUNCTION   ""