diff options
author | José Bollo <jose.bollo@iot.bzh> | 2016-05-13 12:43:13 +0200 |
---|---|---|
committer | José Bollo <jose.bollo@iot.bzh> | 2016-05-13 12:43:13 +0200 |
commit | b5cf93aed93e7f331eb645c8afe5317fb67ee50e (patch) | |
tree | 3010b0c411d6f7d64e4c35882ea1df1bf99eb301 /src/verbose.c | |
parent | 09b02c50df8ae0d87ce7b3e5e092eb93086f5f1e (diff) |
new verbose and clean up
Change-Id: I5217b216d706fd0286c8754e966bca3965d4ea62
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
Diffstat (limited to 'src/verbose.c')
-rw-r--r-- | src/verbose.c | 27 |
1 files changed, 24 insertions, 3 deletions
diff --git a/src/verbose.c b/src/verbose.c index 3f971ce3..82de1779 100644 --- a/src/verbose.c +++ b/src/verbose.c @@ -1,5 +1,5 @@ /* - Copyright 2015 IoT.bzh + Copyright 2016 IoT.bzh author: José Bollo <jose.bollo@iot.bzh> @@ -16,11 +16,13 @@ limitations under the License. */ +#include "verbose.h" + +#if !defined(VERBOSE_WITH_SYSLOG) + #include <stdio.h> #include <stdarg.h> -#include "verbose.h" - int verbosity = 1; static const char *prefixes[] = { @@ -44,3 +46,22 @@ void verbose(int level, const char *file, int line, const char *fmt, ...) va_end(ap); fprintf(stderr, " [%s:%d]\n", file, line); } + +#endif + +#if defined(VERBOSE_WITH_SYSLOG) && !defined(NDEBUG) + +int verbosity = 1; + +#endif + +#if defined(VERBOSE_WITH_SYSLOG) && defined(NDEBUG) + +void verbose_error(const char *file, int line) +{ + syslog(LOG_ERR, "error file %s line %d", file, line); +} + +#endif + + |