TrinityCore
Log.h File Reference
#include "Define.h"
#include "AsioHacksFwd.h"
#include "LogCommon.h"
#include "StringFormat.h"
#include <memory>
#include <unordered_map>
#include <vector>
+ Include dependency graph for Log.h:

Go to the source code of this file.

Classes

class  Log
 

Namespaces

namespace  Trinity
 
namespace  Trinity::Asio
 

Macros

#define LOGGER_ROOT   "root"
 
#define sLog   Log::instance()
 
#define TC_LOG_MESSAGE_BODY(filterType__, level__, ...)
 
#define TC_LOG_TRACE(filterType__, ...)    TC_LOG_MESSAGE_BODY(filterType__, LOG_LEVEL_TRACE, __VA_ARGS__)
 
#define TC_LOG_DEBUG(filterType__, ...)    TC_LOG_MESSAGE_BODY(filterType__, LOG_LEVEL_DEBUG, __VA_ARGS__)
 
#define TC_LOG_INFO(filterType__, ...)    TC_LOG_MESSAGE_BODY(filterType__, LOG_LEVEL_INFO, __VA_ARGS__)
 
#define TC_LOG_WARN(filterType__, ...)    TC_LOG_MESSAGE_BODY(filterType__, LOG_LEVEL_WARN, __VA_ARGS__)
 
#define TC_LOG_ERROR(filterType__, ...)    TC_LOG_MESSAGE_BODY(filterType__, LOG_LEVEL_ERROR, __VA_ARGS__)
 
#define TC_LOG_FATAL(filterType__, ...)    TC_LOG_MESSAGE_BODY(filterType__, LOG_LEVEL_FATAL, __VA_ARGS__)
 

Typedefs

typedef Appender *(* AppenderCreatorFn) (uint8 id, std::string const &name, LogLevel level, AppenderFlags flags, std::vector< std::string_view > const &extraArgs)
 

Functions

template<class AppenderImpl >
AppenderCreateAppender (uint8 id, std::string const &name, LogLevel level, AppenderFlags flags, std::vector< std::string_view > const &extraArgs)
 

Macro Definition Documentation

◆ LOGGER_ROOT

#define LOGGER_ROOT   "root"

Definition at line 41 of file Log.h.

◆ sLog

#define sLog   Log::instance()

Definition at line 130 of file Log.h.

◆ TC_LOG_DEBUG

#define TC_LOG_DEBUG (   filterType__,
  ... 
)     TC_LOG_MESSAGE_BODY(filterType__, LOG_LEVEL_DEBUG, __VA_ARGS__)

Definition at line 156 of file Log.h.

◆ TC_LOG_ERROR

#define TC_LOG_ERROR (   filterType__,
  ... 
)     TC_LOG_MESSAGE_BODY(filterType__, LOG_LEVEL_ERROR, __VA_ARGS__)

Definition at line 165 of file Log.h.

◆ TC_LOG_FATAL

#define TC_LOG_FATAL (   filterType__,
  ... 
)     TC_LOG_MESSAGE_BODY(filterType__, LOG_LEVEL_FATAL, __VA_ARGS__)

Definition at line 168 of file Log.h.

◆ TC_LOG_INFO

#define TC_LOG_INFO (   filterType__,
  ... 
)     TC_LOG_MESSAGE_BODY(filterType__, LOG_LEVEL_INFO, __VA_ARGS__)

Definition at line 159 of file Log.h.

◆ TC_LOG_MESSAGE_BODY

#define TC_LOG_MESSAGE_BODY (   filterType__,
  level__,
  ... 
)
Value:
__pragma(warning(push)) \
__pragma(warning(disable:4127)) \
do { \
if (Log* logInstance = sLog; logInstance->ShouldLog(filterType__, level__)) \
logInstance->OutMessage(filterType__, level__, __VA_ARGS__); \
} while (0) \
__pragma(warning(pop))
#define sLog
Definition: Log.h:130
Definition: Log.h:52

Definition at line 143 of file Log.h.

◆ TC_LOG_TRACE

#define TC_LOG_TRACE (   filterType__,
  ... 
)     TC_LOG_MESSAGE_BODY(filterType__, LOG_LEVEL_TRACE, __VA_ARGS__)

Definition at line 153 of file Log.h.

◆ TC_LOG_WARN

#define TC_LOG_WARN (   filterType__,
  ... 
)     TC_LOG_MESSAGE_BODY(filterType__, LOG_LEVEL_WARN, __VA_ARGS__)

Definition at line 162 of file Log.h.

Typedef Documentation

◆ AppenderCreatorFn

typedef Appender *(* AppenderCreatorFn) (uint8 id, std::string const &name, LogLevel level, AppenderFlags flags, std::vector< std::string_view > const &extraArgs)

Definition at line 43 of file Log.h.

Function Documentation

◆ CreateAppender()

template<class AppenderImpl >
Appender * CreateAppender ( uint8  id,
std::string const &  name,
LogLevel  level,
AppenderFlags  flags,
std::vector< std::string_view > const &  extraArgs 
)

Definition at line 46 of file Log.h.