From efadbf79e9c864578bfd1277d824e69b2989aac5 Mon Sep 17 00:00:00 2001 From: Martin Willi Date: Thu, 30 Mar 2006 07:22:01 +0000 Subject: - rewrote a lot of RSA stuff - done major work for ASN1/decoder - allow loading of ASN1 der encoded private keys, public keys and certificates - extracting public key from certificates - passing certificates from stroke to charon => basic authentication with RSA certificates works! --- Source/charon/utils/logger.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'Source/charon/utils/logger.c') diff --git a/Source/charon/utils/logger.c b/Source/charon/utils/logger.c index 51efa2b8c..c66de481e 100644 --- a/Source/charon/utils/logger.c +++ b/Source/charon/utils/logger.c @@ -192,7 +192,7 @@ static void log_bytes(private_logger_t *this, log_level_t loglevel, char *label, pthread_mutex_lock(&mutex); - format = "%s (%d bytes)"; + format = "%s (%d bytes @%p)"; this->prepend_prefix(this, loglevel, format, buffer); if (this->output == NULL) @@ -201,7 +201,7 @@ static void log_bytes(private_logger_t *this, log_level_t loglevel, char *label, } else { - fprintf(this->output, buffer, label, len); + fprintf(this->output, buffer, label, len, bytes); fprintf(this->output, "\n"); } @@ -293,6 +293,14 @@ static void disable_level(private_logger_t *this, log_level_t log_level) this->level &= ~log_level; } +/** + * Implementation of logger_t.set_output. + */ +static void set_output(private_logger_t *this, FILE * output) +{ + this->output = output; +} + /** * Implementation of logger_t.get_level. */ @@ -324,6 +332,7 @@ logger_t *logger_create(char *logger_name, log_level_t log_level, bool log_threa this->public.enable_level = (void(*)(logger_t*,log_level_t))enable_level; this->public.disable_level = (void(*)(logger_t*,log_level_t))disable_level; this->public.get_level = (log_level_t(*)(logger_t*))get_level; + this->public.set_output = (void(*)(logger_t*,FILE*))set_output; this->public.destroy = (void(*)(logger_t*))destroy; /* private functions */ -- cgit v1.2.3