Changeset fc51296 in mainline for uspace/lib/c/generic/io/log.c
- Timestamp:
- 2011-03-31T17:37:25Z (13 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 3acb285
- Parents:
- 9b415c9
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/c/generic/io/log.c
r9b415c9 rfc51296 35 35 #include <errno.h> 36 36 #include <fibril_synch.h> 37 #include <stdarg.h> 37 38 #include <stdlib.h> 38 39 #include <stdio.h> … … 89 90 va_list args; 90 91 92 va_start(args, fmt); 93 log_msgv(level, fmt, args); 94 va_end(args); 95 } 96 97 /** Write an entry to the log (va_list variant). 98 * 99 * @param level Message verbosity level. Message is only printed 100 * if verbosity is less than or equal to current 101 * reporting level. 102 * @param fmt Format string 103 */ 104 void log_msgv(log_level_t level, const char *fmt, va_list args) 105 { 91 106 assert(level < LVL_LIMIT); 92 107 93 108 /* Higher number means higher verbosity. */ 94 109 if (level <= log_level) { 95 va_start(args, fmt);96 110 fibril_mutex_lock(&log_serializer); 97 111 98 fprintf(log_stream, "%s: %s ", log_prog_name,112 fprintf(log_stream, "%s: %s: ", log_prog_name, 99 113 log_level_names[level]); 100 114 vfprintf(log_stream, fmt, args); … … 102 116 103 117 fibril_mutex_unlock(&log_serializer); 104 va_end(args);105 118 } 106 119 }
Note:
See TracChangeset
for help on using the changeset viewer.