Changeset 1564
- Timestamp:
- 06/17/08 14:42:08 (7 months ago)
- Files:
-
- cherokee/trunk/ChangeLog (modified) (1 diff)
- cherokee/trunk/cherokee/trace.c (modified) (5 diffs)
- cherokee/trunk/cherokee/util.c (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
cherokee/trunk/ChangeLog
r1562 r1564 1 1 2008-06-17 Alvaro Lopez Ortega <alvaro@alobbs.com> 2 3 * cherokee/trace.c (cherokee_trace_do_trace): If "time" is added 4 to CHEROKEE_TRACE it prints the time and date at the begining of 5 each line of the log. 2 6 3 7 * cherokee/thread.c (phase_to_str): It only needed to be compiled cherokee/trunk/cherokee/trace.c
r1131 r1564 35 35 cherokee_buffer_t modules; 36 36 cherokee_boolean_t use_syslog; 37 cherokee_boolean_t print_time; 37 38 } cherokee_trace_t; 38 39 … … 40 41 static cherokee_trace_t trace = { 41 42 CHEROKEE_BUF_INIT, 43 false, 42 44 false 43 45 }; … … 76 78 } 77 79 78 /* Check where to log80 /* Check the special properties 79 81 */ 80 82 trace.use_syslog = (strstr (modules->buf, "syslog") != NULL); 83 trace.print_time = (strstr (modules->buf, "time") != NULL); 81 84 82 85 return ret_ok; … … 91 94 char *lentry_end; 92 95 va_list args; 96 struct tm now; 97 time_t now_time; 93 98 cherokee_buffer_t *trace_modules = &trace.modules; 94 99 cherokee_boolean_t do_log = false; … … 137 142 */ 138 143 cherokee_buffer_clean (&entries); 144 if (trace.print_time) { 145 now_time = time(NULL); 146 cherokee_localtime (&now_time, &now); 147 cherokee_buffer_add_va (&entries, "[%02d/%02d/%d:%02d:%02d:%02d] ", 148 now.tm_mday, 149 now.tm_mon, 150 now.tm_year + 1900, 151 now.tm_hour, 152 now.tm_min, 153 now.tm_sec); 154 } 155 139 156 cherokee_buffer_add_va (&entries, "%18s:%04d (%30s): ", file, line, func); 140 157 cherokee/trunk/cherokee/util.c
r1506 r1564 47 47 #ifdef HAVE_SYS_FILIO_H 48 48 # include <sys/filio.h> /* defines FIONBIO and FIONREAD */ 49 #endif50 51 #ifdef HAVE_SYS_TIME_H52 # include <sys/time.h>53 49 #endif 54 50