Changeset 253 in Main for trunk/Common
- Timestamp:
- Oct 4, 2024, 12:13:36 PM (6 weeks ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Common/log.c
r212 r253 3 3 #include "cm_log.h" 4 4 5 #include "../config.h" 5 6 #include "cm_string.h" 6 7 … … 26 27 #define LOGNAME_LENGTH 12 27 28 29 #ifdef BUILD_GUI_VALID 30 void AddLog(const char* str); 31 #endif 32 28 33 void cm_force_log(const char* log) { 29 34 time_t t = time(NULL); 30 35 struct tm* tm = localtime(&t); 31 36 char date[513]; 37 char* str; 32 38 strftime(date, 512, "%a %b %d %H:%M:%S %Z %Y", tm); 33 39 #ifdef _PSP … … 35 41 #elif defined(__PPU__) 36 42 tt_printf("[%s] %s\n", date, log); 43 #elif defined(BUILD_GUI_VALID) 44 str = malloc(strlen(date) + strlen(log) + 3 + 1); 45 str[strlen(date) + strlen(log) + 3] = 0; 46 sprintf(str, "[%s] %s", date, log); 47 AddLog(str); 48 free(str); 37 49 #else 38 50 fprintf(logfile, "[%s] %s\n", date, log); 51 fflush(logfile); 39 52 #endif 40 fflush(logfile);41 53 } 42 54
Note:
See TracChangeset
for help on using the changeset viewer.