ScummVM API documentation
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
debug.h
1 /* ScummVM - Graphic Adventure Engine
2  *
3  * ScummVM is the legal property of its developers, whose names
4  * are too numerous to list here. Please refer to the COPYRIGHT
5  * file distributed with this source distribution.
6  *
7  * This program is free software: you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation, either version 3 of the License, or
10  * (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this program. If not, see <http://www.gnu.org/licenses/>.
19  *
20  */
21 
22 #ifndef HPL1_DEBUG_H
23 #define HPL1_DEBUG_H
24 
25 #include "common/debug.h"
26 #include "common/textconsole.h"
27 
28 #define HPL1_UNIMPLEMENTED(fnName) error("call to unimplemented function " #fnName)
29 
30 namespace Hpl1 {
31 
32 enum DebugChannels {
33  kDebugGraphics = 1,
34  kDebugResourceLoading,
35  kDebugFilePath,
36  kDebugOpenGL,
37  kDebugRenderer,
38  kDebugAudio,
39  kDebugSaves,
40  kDebugTextures,
41  kDebugScripts,
42  kDebugShaders,
43 };
44 
45 enum DebugLevels {
46  kDebugLevelError = 1,
47  kDebugLevelWarning = 2,
48  kDebugLevelLog = 3
49 };
50 
51 template<typename... Args>
52 void logError(uint32 channels, const char *fmt, Args... args) {
53  debugCN(kDebugLevelError, channels, fmt, args...);
54 }
55 
56 template<typename... Args>
57 void logWarning(uint32 channels, const char *fmt, Args... args) {
58  debugCN(kDebugLevelWarning, channels, fmt, args...);
59 }
60 
61 template<typename... Args>
62 void logInfo(uint32 channels, const char *fmt, Args... args) {
63  debugCN(kDebugLevelLog, channels, fmt, args...);
64 }
65 
66 } // namespace Hpl1
67 
68 #endif
void void void void void void debugCN(int level, uint32 debugChannel, MSVC_PRINTF const char *s,...) GCC_PRINTF(3
Definition: algorithms.h:27