TrinityCore
enuminfo_LogCommon.cpp
Go to the documentation of this file.
1/*
2 * This file is part of the TrinityCore Project. See AUTHORS file for Copyright information
3 *
4 * This program is free software; you can redistribute it and/or modify it
5 * under the terms of the GNU General Public License as published by the
6 * Free Software Foundation; either version 2 of the License, or (at your
7 * option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
12 * more details.
13 *
14 * You should have received a copy of the GNU General Public License along
15 * with this program. If not, see <http://www.gnu.org/licenses/>.
16 */
17
18#include "LogCommon.h"
19#include "Define.h"
20#include "SmartEnum.h"
21#include <stdexcept>
22
24{
25
26/************************************************************\
27|* data for enum 'LogLevel' in 'LogCommon.h' auto-generated *|
28\************************************************************/
29template <>
31{
32 switch (value)
33 {
34 case LOG_LEVEL_DISABLED: return { "LOG_LEVEL_DISABLED", "LOG_LEVEL_DISABLED", "" };
35 case LOG_LEVEL_TRACE: return { "LOG_LEVEL_TRACE", "LOG_LEVEL_TRACE", "" };
36 case LOG_LEVEL_DEBUG: return { "LOG_LEVEL_DEBUG", "LOG_LEVEL_DEBUG", "" };
37 case LOG_LEVEL_INFO: return { "LOG_LEVEL_INFO", "LOG_LEVEL_INFO", "" };
38 case LOG_LEVEL_WARN: return { "LOG_LEVEL_WARN", "LOG_LEVEL_WARN", "" };
39 case LOG_LEVEL_ERROR: return { "LOG_LEVEL_ERROR", "LOG_LEVEL_ERROR", "" };
40 case LOG_LEVEL_FATAL: return { "LOG_LEVEL_FATAL", "LOG_LEVEL_FATAL", "" };
41 default: throw std::out_of_range("value");
42 }
43}
44
45template <>
47
48template <>
50{
51 switch (index)
52 {
53 case 0: return LOG_LEVEL_DISABLED;
54 case 1: return LOG_LEVEL_TRACE;
55 case 2: return LOG_LEVEL_DEBUG;
56 case 3: return LOG_LEVEL_INFO;
57 case 4: return LOG_LEVEL_WARN;
58 case 5: return LOG_LEVEL_ERROR;
59 case 6: return LOG_LEVEL_FATAL;
60 default: throw std::out_of_range("index");
61 }
62}
63
64template <>
66{
67 switch (value)
68 {
69 case LOG_LEVEL_DISABLED: return 0;
70 case LOG_LEVEL_TRACE: return 1;
71 case LOG_LEVEL_DEBUG: return 2;
72 case LOG_LEVEL_INFO: return 3;
73 case LOG_LEVEL_WARN: return 4;
74 case LOG_LEVEL_ERROR: return 5;
75 case LOG_LEVEL_FATAL: return 6;
76 default: throw std::out_of_range("value");
77 }
78}
79
80/****************************************************************\
81|* data for enum 'AppenderType' in 'LogCommon.h' auto-generated *|
82\****************************************************************/
83template <>
85{
86 switch (value)
87 {
88 case APPENDER_NONE: return { "APPENDER_NONE", "APPENDER_NONE", "" };
89 case APPENDER_CONSOLE: return { "APPENDER_CONSOLE", "APPENDER_CONSOLE", "" };
90 case APPENDER_FILE: return { "APPENDER_FILE", "APPENDER_FILE", "" };
91 case APPENDER_DB: return { "APPENDER_DB", "APPENDER_DB", "" };
92 default: throw std::out_of_range("value");
93 }
94}
95
96template <>
98
99template <>
101{
102 switch (index)
103 {
104 case 0: return APPENDER_NONE;
105 case 1: return APPENDER_CONSOLE;
106 case 2: return APPENDER_FILE;
107 case 3: return APPENDER_DB;
108 default: throw std::out_of_range("index");
109 }
110}
111
112template <>
114{
115 switch (value)
116 {
117 case APPENDER_NONE: return 0;
118 case APPENDER_CONSOLE: return 1;
119 case APPENDER_FILE: return 2;
120 case APPENDER_DB: return 3;
121 default: throw std::out_of_range("value");
122 }
123}
124}
#define TC_API_EXPORT
Definition: Define.h:92
AppenderType
Definition: LogCommon.h:40
@ APPENDER_FILE
Definition: LogCommon.h:43
@ APPENDER_CONSOLE
Definition: LogCommon.h:42
@ APPENDER_DB
Definition: LogCommon.h:44
@ APPENDER_NONE
Definition: LogCommon.h:41
LogLevel
Definition: LogCommon.h:25
@ LOG_LEVEL_DEBUG
Definition: LogCommon.h:28
@ LOG_LEVEL_ERROR
Definition: LogCommon.h:31
@ LOG_LEVEL_FATAL
Definition: LogCommon.h:32
@ LOG_LEVEL_TRACE
Definition: LogCommon.h:27
@ LOG_LEVEL_WARN
Definition: LogCommon.h:30
@ LOG_LEVEL_DISABLED
Definition: LogCommon.h:26
@ LOG_LEVEL_INFO
Definition: LogCommon.h:29
static size_t ToIndex(Enum index)
static EnumText ToString(Enum value)
static Enum FromIndex(size_t index)