comparison src/log.c @ 395:5f0829f8e6c7

Removed log_max_pri limit. It makes no sense.
author markus schnalke <meillo@marmaro.de>
date Sat, 18 Feb 2012 19:39:11 +0100
parents 9bc3e47b0222
children 19be3b27df6f
comparison
equal deleted inserted replaced
394:c8e3d1a79313 395:5f0829f8e6c7
123 123
124 pri &= ~LOG_VERBOSE; 124 pri &= ~LOG_VERBOSE;
125 if (!pri) { 125 if (!pri) {
126 return; 126 return;
127 } 127 }
128 if (conf.use_syslog) 128 if (conf.use_syslog) {
129 vsyslog(pri, fmt, args); 129 vsyslog(pri, fmt, args);
130 else if (pri <= conf.log_max_pri) { 130 return;
131 FILE *file = logfile ? logfile : stderr; 131 }
132 time_t now = time(NULL); 132 FILE *file = logfile ? logfile : stderr;
133 struct tm *t = localtime(&now); 133 time_t now = time(NULL);
134 gchar buf[24]; 134 struct tm *t = localtime(&now);
135 135 gchar buf[24];
136 strftime(buf, 24, "%Y-%m-%d %H:%M:%S", t); 136
137 fprintf(file, "%s [%d] ", buf, getpid()); 137 strftime(buf, 24, "%Y-%m-%d %H:%M:%S", t);
138 138 fprintf(file, "%s [%d] ", buf, getpid());
139 vfprintf(file, fmt, args); 139
140 fflush(file); 140 vfprintf(file, fmt, args);
141 } 141 fflush(file);
142 } 142 }
143 143
144 #ifdef ENABLE_DEBUG 144 #ifdef ENABLE_DEBUG
145 void 145 void
146 vdebugwrite(int pri, const char *fmt, va_list args) 146 vdebugwrite(int pri, const char *fmt, va_list args)