|
|
@@ -40,7 +40,13 @@ bool IZ_LogIsSupportedColor(FILE* s) { |
|
|
|
#endif |
|
|
|
} |
|
|
|
|
|
|
|
void IZ_LogInitialize(const char* context) { |
|
|
|
void IZ_LogInitialize(const char* context, bool force_output) { |
|
|
|
if (force_output) { |
|
|
|
stdout_dest = stdout; |
|
|
|
stderr_dest = stderr; |
|
|
|
return; |
|
|
|
} |
|
|
|
|
|
|
|
#ifdef IZ_DEBUG |
|
|
|
stdout_dest = stdout; |
|
|
|
stderr_dest = stderr; |
|
|
@@ -54,8 +60,8 @@ void IZ_LogInitialize(const char* context) { |
|
|
|
char* now = IZ_TimerNowPathSafe(); |
|
|
|
|
|
|
|
// fixme |
|
|
|
sprintf(stdout_filename, "%s/out-%s-%s.log", log_dir, context, now); |
|
|
|
sprintf(stderr_filename, "%s/err-%s-%s.log", log_dir, context, now); |
|
|
|
sprintf(stdout_filename, "%s/%s-out-%s.log", log_dir, context, now); |
|
|
|
sprintf(stderr_filename, "%s/%s-err-%s.log", log_dir, context, now); |
|
|
|
IZ_fopen(&stdout_dest, stdout_filename, "a"); |
|
|
|
IZ_fopen(&stderr_dest, stderr_filename, "a"); |
|
|
|
#endif |
|
|
@@ -63,7 +69,11 @@ void IZ_LogInitialize(const char* context) { |
|
|
|
|
|
|
|
void IZ_LogTeardown() { |
|
|
|
#ifndef IZ_DEBUG |
|
|
|
if (IZ_LogIsSupportedColor(stdout_dest)) { |
|
|
|
return; |
|
|
|
} |
|
|
|
fclose(stdout_dest); |
|
|
|
fclose(stderr_dest); |
|
|
|
#endif |
|
|
|
} |
|
|
|
|
|
|
|