mirror of
https://github.com/MobileGL-Dev/MobileGL
synced 2026-09-09 04:38:30 +09:00
[Fix] (Debug.cpp): FIx the format mistake of log file.
This commit is contained in:
@@ -73,11 +73,11 @@ namespace MG_Util::Debug {
|
||||
#ifdef __ANDROID__
|
||||
__android_log_vprint(androidLevel, MG_Constants::RenderName, full_format.c_str(), args);
|
||||
#endif
|
||||
|
||||
|
||||
vprintf(full_format.c_str(), args);
|
||||
va_list args_copy;
|
||||
va_copy(args_copy, args);
|
||||
LogWrite(full_format.c_str(), args);
|
||||
LogWrite(full_format.c_str(), args_copy);
|
||||
va_end(args_copy);
|
||||
}
|
||||
|
||||
@@ -120,12 +120,10 @@ void Log##name(const char* format, ...) { \
|
||||
logFile = fopen(MG_Global::Common::LOG_FILE_PATH, "a");
|
||||
}
|
||||
|
||||
void LogWrite(const char* format, ...) {
|
||||
void LogWrite(const char* format, va_list args) {
|
||||
if (!MG_Global::Common::LOG_FILE_PATH || logFile == nullptr)
|
||||
return;
|
||||
|
||||
va_list args;
|
||||
va_start(args, format);
|
||||
vfprintf(logFile, format, args);
|
||||
va_end(args);
|
||||
fflush(logFile);
|
||||
|
||||
@@ -20,7 +20,7 @@ namespace MG_Util {
|
||||
void LogF (const char* format, ...);
|
||||
void LogClear();
|
||||
void LogInit();
|
||||
void LogWrite(const char* format, ...);
|
||||
void LogWrite(const char* format, va_list args);
|
||||
|
||||
const char* GLEnumToString(::GLenum value);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user