TrinityCore
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
Log.h File Reference
#include "Define.h"
#include "Appender.h"
#include "Logger.h"
#include "StringFormat.h"
#include "Common.h"
#include <boost/asio/io_service.hpp>
#include <boost/asio/strand.hpp>
#include <stdarg.h>
#include <unordered_map>
#include <string>
#include <memory>
+ Include dependency graph for Log.h:

Go to the source code of this file.

Classes

class  Log
 

Macros

#define LOGGER_ROOT   "root"
 
#define sLog   Log::instance()
 
#define LOG_EXCEPTION_FREE(filterType__, level__,...)
 
#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__)
 

Macro Definition Documentation

#define LOG_EXCEPTION_FREE (   filterType__,
  level__,
  ... 
)
Value:
{ \
try \
{ \
sLog->outMessage(filterType__, level__, __VA_ARGS__); \
} \
catch (std::exception& e) \
{ \
sLog->outMessage("server", LOG_LEVEL_ERROR, "Wrong format occurred (%s) at %s:%u.", \
e.what(), __FILE__, __LINE__); \
} \
}
#define sLog
Definition: Log.h:154
Definition: Appender.h:38
#define LOGGER_ROOT   "root"
#define sLog   Log::instance()
#define TC_LOG_DEBUG (   filterType__,
  ... 
)    TC_LOG_MESSAGE_BODY(filterType__, LOG_LEVEL_DEBUG, __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__)
#define TC_LOG_INFO (   filterType__,
  ... 
)    TC_LOG_MESSAGE_BODY(filterType__, LOG_LEVEL_INFO, __VA_ARGS__)
#define TC_LOG_MESSAGE_BODY (   filterType__,
  level__,
  ... 
)
Value:
__pragma(warning(push)) \
__pragma(warning(disable:4127)) \
do { \
if (sLog->ShouldLog(filterType__, level__)) \
LOG_EXCEPTION_FREE(filterType__, level__, __VA_ARGS__); \
} while (0) \
__pragma(warning(pop))
#define sLog
Definition: Log.h:154
#define LOG_EXCEPTION_FREE(filterType__, level__,...)
Definition: Log.h:156
#define TC_LOG_TRACE (   filterType__,
  ... 
)    TC_LOG_MESSAGE_BODY(filterType__, LOG_LEVEL_TRACE, __VA_ARGS__)
#define TC_LOG_WARN (   filterType__,
  ... 
)    TC_LOG_MESSAGE_BODY(filterType__, LOG_LEVEL_WARN, __VA_ARGS__)