Changes in uspace/lib/usb/src/debug.c [ef7f043:aa389fd] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/usb/src/debug.c
ref7f043 raa389fd 206 206 void usb_log_printf(usb_log_level_t level, const char *format, ...) 207 207 { 208 FILE *s creen_stream = NULL;208 FILE *stream = NULL; 209 209 switch (level) { 210 210 case USB_LOG_LEVEL_FATAL: 211 211 case USB_LOG_LEVEL_ERROR: 212 s creen_stream = stderr;212 stream = stderr; 213 213 break; 214 214 default: 215 s creen_stream = stdout;215 stream = stdout; 216 216 break; 217 217 } 218 assert(s creen_stream != NULL);218 assert(stream != NULL); 219 219 220 220 va_list args; 221 va_start(args, format); 221 222 222 223 /* … … 230 231 231 232 if (log_stream != NULL) { 232 va_start(args, format);233 234 233 fprintf(log_stream, "[%s]%s: ", log_prefix, level_name); 235 234 vfprintf(log_stream, format, args); 236 fflush(log_stream);237 238 va_end(args);239 235 } 240 236 241 237 if (level <= log_level) { 242 va_start(args, format); 243 244 fprintf(screen_stream, "[%s]%s: ", log_prefix, level_name); 245 vfprintf(screen_stream, format, args); 246 fflush(screen_stream); 247 248 va_end(args); 238 fprintf(stream, "[%s]%s: ", log_prefix, level_name); 239 vfprintf(stream, format, args); 249 240 } 250 241 251 242 fibril_mutex_unlock(&log_serializer); 243 244 va_end(args); 252 245 } 253 246
Note:
See TracChangeset
for help on using the changeset viewer.