diff options
author | Martin Willi <martin@strongswan.org> | 2006-10-18 11:46:13 +0000 |
---|---|---|
committer | Martin Willi <martin@strongswan.org> | 2006-10-18 11:46:13 +0000 |
commit | 60356f3375da67375e48691bb1d732c02d1681a1 (patch) | |
tree | 1bfa3bd28d46c4211a17a831094e7fcbceea8bb6 /src/libstrongswan/library.c | |
parent | 8cdce67afa4bc4b4ff1a05e956db08cddc5dc48e (diff) | |
download | strongswan-60356f3375da67375e48691bb1d732c02d1681a1.tar.bz2 strongswan-60356f3375da67375e48691bb1d732c02d1681a1.tar.xz |
introduced new logging subsystem using bus:
passive listeners can register on the bus
active listeners wait for signals actively
multiplexing allows multiple listeners to receive debug signals
a lot more...
Diffstat (limited to 'src/libstrongswan/library.c')
-rw-r--r-- | src/libstrongswan/library.c | 31 |
1 files changed, 15 insertions, 16 deletions
diff --git a/src/libstrongswan/library.c b/src/libstrongswan/library.c index f561f2451..0394f32d7 100644 --- a/src/libstrongswan/library.c +++ b/src/libstrongswan/library.c @@ -1,8 +1,8 @@ /** * @file library.c - * + * * @brief Library (de-)initialization. - * + * */ /* @@ -21,23 +21,22 @@ * for more details. */ -#include <utils/logger_manager.h> -#include <utils/leak_detective.h> +#include <stdarg.h> +#include <stdio.h> -/** - * Called whenever the library is linked from a process - */ -void __attribute__ ((constructor)) library_init(void) -{ - logger_manager_init(); - leak_detective_init(); -} +#include "library.h" /** - * Called whenever the library is unlinked from a process + * default dbg function which printf all to stderr */ -void __attribute__ ((destructor)) library_cleanup(void) +static void dbg_stderr(int level, char *fmt, ...) { - leak_detective_cleanup(); - logger_manager_cleanup(); + va_list args; + + va_start(args, fmt); + vfprintf(stderr, fmt, args); + fprintf(stderr, "\n"); + va_end(args); } + +void (*dbg) (int level, char *fmt, ...) = dbg_stderr; |