CSEngine
Loading...
Searching...
No Matches
SafeLog.cpp
1
#include "SafeLog.h"
2
3
#ifdef _WIN32
4
5
#include <Windows.h>
6
#include <cstdio>
7
8
#elif __ANDROID__
9
#define LOG_TAG "CSEngine"
10
#define LOGI(...) __android_log_print(ANDROID_LOG_INFO,LOG_TAG,__VA_ARGS__)
11
#define LOGE(...) __android_log_print(ANDROID_LOG_ERROR,LOG_TAG,__VA_ARGS__)
12
#include <android/log.h>
13
#endif
14
#if defined(__linux__) || defined(__EMSCRIPTEN__) || defined(__APPLE_CC__)
15
#include <cstdio>
16
#endif
17
18
#ifdef __CSE_EDITOR__
19
20
#include "../../Editor/src/Manager/EEngineCore.h"
21
22
#endif
23
24
void
SafeLog::Log(
const
char
* log) {
25
#ifdef __CSE_EDITOR__
26
const
auto
& editorCore = CSEditor::EEngineCore::getEditorInstance();
27
if
(editorCore->IsReady()) editorCore->AddLog(log);
28
else
puts(log);
29
#elif _WIN32
30
OutputDebugStringA(log);
31
puts(log);
32
#elif __ANDROID__
33
LOGE(log, 0);
34
#elif __linux__
35
puts(log);
36
#elif __EMSCRIPTEN__
37
puts(log);
38
#elif __APPLE_CC__
39
puts(log);
40
#endif
41
}
Util
SafeLog.cpp
Generated on Wed Oct 8 2025 01:09:56 for CSEngine by
1.12.0