TrinityCore
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
Appender.h File Reference
#include <unordered_map>
#include <stdexcept>
#include <string>
#include <time.h>
#include <type_traits>
#include <vector>
#include <utility>
#include "Define.h"
+ Include dependency graph for Appender.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  LogMessage
 
class  Appender
 
class  InvalidAppenderArgsException
 

Typedefs

typedef std::unordered_map
< uint8, Appender * > 
AppenderMap
 
typedef std::vector< char const * > ExtraAppenderArgs
 
typedef Appender *(* AppenderCreatorFn )(uint8 id, std::string const &name, LogLevel level, AppenderFlags flags, ExtraAppenderArgs extraArgs)
 
typedef std::unordered_map
< uint8, AppenderCreatorFn
AppenderCreatorMap
 

Enumerations

enum  LogLevel {
  LOG_LEVEL_DISABLED = 0, LOG_LEVEL_TRACE = 1, LOG_LEVEL_DEBUG = 2, LOG_LEVEL_INFO = 3,
  LOG_LEVEL_WARN = 4, LOG_LEVEL_ERROR = 5, LOG_LEVEL_FATAL = 6
}
 
enum  AppenderType : uint8 { APPENDER_NONE, APPENDER_CONSOLE, APPENDER_FILE, APPENDER_DB }
 
enum  AppenderFlags {
  APPENDER_FLAGS_NONE = 0x00, APPENDER_FLAGS_PREFIX_TIMESTAMP = 0x01, APPENDER_FLAGS_PREFIX_LOGLEVEL = 0x02, APPENDER_FLAGS_PREFIX_LOGFILTERTYPE = 0x04,
  APPENDER_FLAGS_USE_TIMESTAMP = 0x08, APPENDER_FLAGS_MAKE_FILE_BACKUP = 0x10
}
 

Functions

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

Variables

const uint8 MaxLogLevels = 6
 

Typedef Documentation

typedef Appender*(* AppenderCreatorFn)(uint8 id, std::string const &name, LogLevel level, AppenderFlags flags, ExtraAppenderArgs extraArgs)
typedef std::unordered_map<uint8, AppenderCreatorFn> AppenderCreatorMap
typedef std::unordered_map<uint8, Appender*> AppenderMap
typedef std::vector<char const*> ExtraAppenderArgs

Enumeration Type Documentation

Enumerator
APPENDER_FLAGS_NONE 
APPENDER_FLAGS_PREFIX_TIMESTAMP 
APPENDER_FLAGS_PREFIX_LOGLEVEL 
APPENDER_FLAGS_PREFIX_LOGFILTERTYPE 
APPENDER_FLAGS_USE_TIMESTAMP 
APPENDER_FLAGS_MAKE_FILE_BACKUP 
53 {
54  APPENDER_FLAGS_NONE = 0x00,
58  APPENDER_FLAGS_USE_TIMESTAMP = 0x08, // only used by FileAppender
59  APPENDER_FLAGS_MAKE_FILE_BACKUP = 0x10 // only used by FileAppender
60 };
Definition: Appender.h:55
Definition: Appender.h:57
Definition: Appender.h:56
Definition: Appender.h:58
Definition: Appender.h:54
Definition: Appender.h:59
Enumerator
APPENDER_NONE 
APPENDER_CONSOLE 
APPENDER_FILE 
APPENDER_DB 
44  : uint8
45 {
50 };
Definition: Appender.h:46
Definition: Appender.h:47
uint8_t uint8
Definition: Define.h:152
Definition: Appender.h:48
Definition: Appender.h:49
enum LogLevel
Enumerator
LOG_LEVEL_DISABLED 
LOG_LEVEL_TRACE 
LOG_LEVEL_DEBUG 
LOG_LEVEL_INFO 
LOG_LEVEL_WARN 
LOG_LEVEL_ERROR 
LOG_LEVEL_FATAL 
32 {
34  LOG_LEVEL_TRACE = 1,
35  LOG_LEVEL_DEBUG = 2,
36  LOG_LEVEL_INFO = 3,
37  LOG_LEVEL_WARN = 4,
38  LOG_LEVEL_ERROR = 5,
39  LOG_LEVEL_FATAL = 6
40 };
Definition: Appender.h:35
Definition: Appender.h:34
Definition: Appender.h:36
Definition: Appender.h:37
Definition: Appender.h:38
Definition: Appender.h:33
Definition: Appender.h:39

Function Documentation

template<class AppenderImpl >
Appender* CreateAppender ( uint8  id,
std::string const name,
LogLevel  level,
AppenderFlags  flags,
ExtraAppenderArgs  extraArgs 
)
122 {
123  return new AppenderImpl(id, name, level, flags, std::forward<ExtraAppenderArgs>(extraArgs));
124 }
uint8 flags
Definition: DisableMgr.cpp:44

Variable Documentation

const uint8 MaxLogLevels = 6