[286] | 1 | // This file is a part of Framsticks SDK. http://www.framsticks.com/ |
---|
| 2 | // Copyright (C) 1999-2015 Maciej Komosinski and Szymon Ulatowski. |
---|
| 3 | // See LICENSE.txt for details. |
---|
[122] | 4 | |
---|
[375] | 5 | #ifndef _COMMON_LOG_H_ |
---|
| 6 | #define _COMMON_LOG_H_ |
---|
[109] | 7 | |
---|
| 8 | #include <stdarg.h> |
---|
| 9 | |
---|
[375] | 10 | extern const char* LOG_LEVEL[]; |
---|
| 11 | #define LOG_FORMAT "%s%s.%s: %s" |
---|
| 12 | #define LOG_MULTILINE_CONTINUATION "..." |
---|
[109] | 13 | |
---|
| 14 | |
---|
[375] | 15 | void logPrintf(const char *obj, const char *method, int level, const char *msgf, ...); |
---|
| 16 | void logPrintf_va(const char *obj, const char *method, int level, const char *msgf, va_list va); //a different name than logPrintf - otherwise the compiler could confuse the "string" parameter with va_list and could call the wrong function |
---|
| 17 | void log_printf(const char *msgf, ...); //a shorthand for printf (a different name again to avoid the risk of confusion with the two functions above. This would be unlikely but possible when the argument types would match) |
---|
| 18 | void logMessage(const char *obj, const char *method, int level, const char *msg); |
---|
[244] | 19 | |
---|
[375] | 20 | void _logMessageSingleLine(const char *obj, const char *method, int level, const char *msg); //don't call this directly - it is used internally |
---|
[109] | 21 | |
---|
| 22 | |
---|
[375] | 23 | |
---|
| 24 | //level (importance) of a message |
---|
| 25 | #define LOG_DEBUG -1 //debugging information, not needed for final users |
---|
| 26 | #define LOG_INFO 0 //information |
---|
| 27 | #define LOG_WARN 1 //warning or corrected error |
---|
| 28 | #define LOG_ERROR 2 //uncorrected error, can cause malfunction |
---|
| 29 | #define LOG_CRITICAL 3 //serious error, causes side effects. User should save what can be saved and restart the application |
---|
| 30 | |
---|
[109] | 31 | #endif |
---|