Changeset c1888a5 in code
- Timestamp:
- Mar 5, 2014, 11:04:58 PM (11 years ago)
- Branches:
- master
- Children:
- 9a2a703
- Parents:
- 23ca6f1
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
logger.c
r23ca6f1 rc1888a5 239 239 logger_setts(void) 240 240 { 241 static int last_mon = -1; 241 242 struct tm *tm; 242 243 time_t t; 244 int i; 243 245 244 246 time(&t); 245 247 tm = gmtime(&t); 246 snprintf(file_ts, sizeof file_ts, "%04d-%02d", tm->tm_year + 1900, 247 tm->tm_mon + 1); 248 if (last_mon != tm->tm_mon) { 249 snprintf(file_ts, sizeof file_ts, "%04d-%02d", tm->tm_year + 250 1900, tm->tm_mon + 1); 251 last_mon = tm->tm_mon; 252 for (i = 0; i < nlogfiles; i++) { 253 fclose(logfiles[i].fp); 254 logfiles[i].fp = NULL; 255 } 256 nlogfiles = 0; 257 } 248 258 snprintf(line_ts, sizeof line_ts, "[%02d:%02d] ", tm->tm_hour, 249 259 tm->tm_min);
Note:
See TracChangeset
for help on using the changeset viewer.