Code Review
/
src
/
app-framework-binder.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
review
|
tree
raw
|
inline
| side by side
fixup session memory leak
[src/app-framework-binder.git]
/
src
/
verbose.c
diff --git
a/src/verbose.c
b/src/verbose.c
index
7e46a33
..
3f971ce
100644
(file)
--- a/
src/verbose.c
+++ b/
src/verbose.c
@@
-16,14
+16,31
@@
limitations under the License.
*/
limitations under the License.
*/
+#include <stdio.h>
+#include <stdarg.h>
+
#include "verbose.h"
#include "verbose.h"
-#if !defined(NDEBUG)
int verbosity = 1;
int verbosity = 1;
-#else
-void verbose_error(const char *file, int line)
+
+static const char *prefixes[] = {
+ "<0> EMERGENCY",
+ "<1> ALERT",
+ "<2> CRITICAL",
+ "<3> ERROR",
+ "<4> WARNING",
+ "<5> NOTICE",
+ "<6> INFO",
+ "<7> DEBUG"
+};
+
+void verbose(int level, const char *file, int line, const char *fmt, ...)
{
{
- syslog(LOG_ERR, "error file %s line %d", file, line);
-}
-#endif
+ va_list ap;
+ fprintf(stderr, "%s: ", prefixes[level < 0 ? 0 : level > 7 ? 7 : level]);
+ va_start(ap, fmt);
+ vfprintf(stderr, fmt, ap);
+ va_end(ap);
+ fprintf(stderr, " [%s:%d]\n", file, line);
+}