]> git.lizzy.rs Git - shadowclad.git/blob - src/engine/logger.h
Add copyright and license notices in source code
[shadowclad.git] / src / engine / logger.h
1 /**
2  * Copyright 2019-2020 Iwo 'Outfrost' Bujkiewicz
3  *
4  * This Source Code Form is subject to the terms of the Mozilla Public
5  * License, v. 2.0. If a copy of the MPL was not distributed with this
6  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
7  */
8
9 #ifndef ENGINE_LOGGER_H_
10 #define ENGINE_LOGGER_H_
11
12 enum LogLevel {
13         LOGLEVEL_ERROR,
14         LOGLEVEL_WARNING,
15         LOGLEVEL_INFO,
16         LOGLEVEL_DEBUG
17 };
18
19 typedef enum LogLevel LogLevel;
20
21 extern LogLevel logLevel;
22
23 #define logError(...) logMessage(LOGLEVEL_ERROR, __func__, __VA_ARGS__)
24 #define logWarning(...) logMessage(LOGLEVEL_WARNING, __func__, __VA_ARGS__)
25 #define logInfo(...) logMessage(LOGLEVEL_INFO, __func__, __VA_ARGS__)
26 #define logDebug(...) logMessage(LOGLEVEL_DEBUG, __func__, __VA_ARGS__)
27
28 void logMessage(LogLevel msgLevel, const char* func, const char* message, ...);
29
30 #endif // ENGINE_LOGGER_H_