CSEngine
Loading...
Searching...
No Matches
SafeLog.cpp
1#include "SafeLog.h"
2
3#ifdef _WIN32
4#include <Windows.h>
5#include <cstdio>
6
7#elif __ANDROID__
8#define LOG_TAG "CSEngine"
9#define LOGI(...) __android_log_print(ANDROID_LOG_INFO,LOG_TAG,__VA_ARGS__)
10#define LOGE(...) __android_log_print(ANDROID_LOG_ERROR,LOG_TAG,__VA_ARGS__)
11#include <android/log.h>
12#endif
13#if defined(__linux__) || defined(__EMSCRIPTEN__) || defined(__APPLE_CC__)
14#include <cstdio>
15#endif
16
17void SafeLog::Log(const char* log) {
18
19#ifdef _WIN32
20 OutputDebugStringA(log);
21 puts(log);
22#elif __ANDROID__
23 LOGE(log, 0);
24#elif __linux__
25 puts(log);
26#elif __EMSCRIPTEN__
27 puts(log);
28#elif __APPLE_CC__
29 puts(log);
30#endif
31
32}