1
0
mirror of https://github.com/blawar/GLideN64.git synced 2024-06-30 08:24:05 +00:00
GLideN64/src/Log.h

45 lines
849 B
C
Raw Normal View History

2014-04-07 05:08:16 +00:00
#ifndef __LOG_H__
#define __LOG_H__
#define LOG_NONE 0
#define LOG_ERROR 1
#define LOG_MINIMAL 2
#define LOG_WARNING 3
#define LOG_VERBOSE 4
2014-09-11 10:03:54 +00:00
#define LOG_APIFUNC 5
2014-04-07 05:08:16 +00:00
#define LOG_LEVEL LOG_WARNING
2014-04-07 05:08:16 +00:00
#if LOG_LEVEL > 0
2014-04-07 05:08:16 +00:00
#include "Types.h"
2019-09-28 15:31:39 +00:00
#include <cstdio>
#include <string>
2019-11-30 13:01:29 +00:00
// for strrchr
#include <string.h>
2019-04-10 04:29:06 +00:00
#ifdef OS_WINDOWS
#define __FILENAME__ (strrchr(__FILE__, '\\') ? strrchr(__FILE__, '\\') + 1 : __FILE__)
#else
#define __FILENAME__ (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
#endif //OS_WINDOWS
#define LOG(...) LogDebug(__FILENAME__, __LINE__, __VA_ARGS__)
void LogDebug(const char* _fileName, int _line, u16 _type, const char* _format, ...);
2014-04-07 05:08:16 +00:00
#else
#define LOG(A, ...)
#endif
2018-11-14 20:09:17 +00:00
#if defined(OS_WINDOWS) && !defined(MINGW)
void debugPrint(const char * format, ...);
#else
#define debugPrint(A, ...)
#endif
2014-04-07 05:08:16 +00:00
#endif