mirror of
https://github.com/MobileGL-Dev/MobileGL
synced 2026-09-13 06:38:31 +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__
|
#ifdef __ANDROID__
|
||||||
__android_log_vprint(androidLevel, MG_Constants::RenderName, full_format.c_str(), args);
|
__android_log_vprint(androidLevel, MG_Constants::RenderName, full_format.c_str(), args);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
vprintf(full_format.c_str(), args);
|
vprintf(full_format.c_str(), args);
|
||||||
va_list args_copy;
|
va_list args_copy;
|
||||||
va_copy(args_copy, args);
|
va_copy(args_copy, args);
|
||||||
LogWrite(full_format.c_str(), args);
|
LogWrite(full_format.c_str(), args_copy);
|
||||||
va_end(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");
|
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)
|
if (!MG_Global::Common::LOG_FILE_PATH || logFile == nullptr)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
va_list args;
|
|
||||||
va_start(args, format);
|
|
||||||
vfprintf(logFile, format, args);
|
vfprintf(logFile, format, args);
|
||||||
va_end(args);
|
va_end(args);
|
||||||
fflush(logFile);
|
fflush(logFile);
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ namespace MG_Util {
|
|||||||
void LogF (const char* format, ...);
|
void LogF (const char* format, ...);
|
||||||
void LogClear();
|
void LogClear();
|
||||||
void LogInit();
|
void LogInit();
|
||||||
void LogWrite(const char* format, ...);
|
void LogWrite(const char* format, va_list args);
|
||||||
|
|
||||||
const char* GLEnumToString(::GLenum value);
|
const char* GLEnumToString(::GLenum value);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user