diff options
Diffstat (limited to 'src/assuan-logging.c')
-rw-r--r-- | src/assuan-logging.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/src/assuan-logging.c b/src/assuan-logging.c index 0e57579..fa2e3c2 100644 --- a/src/assuan-logging.c +++ b/src/assuan-logging.c @@ -45,6 +45,16 @@ static char prefix_buffer[80]; static int full_logging; +static FILE *_assuan_log; + +void +assuan_set_assuan_log_stream (FILE *fp) +{ + _assuan_log = fp; + full_logging = !!getenv ("ASSUAN_FULL_LOGGING"); +} + + /* Set the per context log stream. Also enable the default log stream if it has not been set. */ void @@ -96,7 +106,7 @@ _assuan_log_handler (assuan_context_t ctx, void *hook, unsigned int cat, if (msg == NULL) return 1; - fp = ctx->log_fp; + fp = ctx->log_fp ? ctx->log_fp : _assuan_log; if (!fp) return 0; |