From da28f16dd8f3ceada766fe91c8fa4c5534d8ba8d Mon Sep 17 00:00:00 2001 From: Angus Salkeld Date: Wed, 30 Mar 2011 21:22:27 +1100 Subject: [PATCH] LOG: add qb_log_file_close() Signed-off-by: Angus Salkeld --- include/qb/qblog.h | 5 +++++ lib/log_file.c | 6 ++++++ 2 files changed, 11 insertions(+) diff --git a/include/qb/qblog.h b/include/qb/qblog.h index 8ab2b28..c53f344 100644 --- a/include/qb/qblog.h +++ b/include/qb/qblog.h @@ -178,6 +178,11 @@ int32_t qb_log_filter_ctl(uint32_t t, enum qb_log_filter_conf c, int32_t qb_log_file_open(const char *filename); +/** + * Close a log file and release is resources. + */ +void qb_log_file_close(int32_t t); + /** * Start the logging pthread. */ diff --git a/lib/log_file.c b/lib/log_file.c index ec4a165..849846a 100644 --- a/lib/log_file.c +++ b/lib/log_file.c @@ -84,4 +84,10 @@ int32_t qb_log_file_open(const char *filename) return t->pos; } +void qb_log_file_close(int32_t t) +{ + struct qb_log_target * target = qb_log_target_get(t); + target->close(target); + qb_log_target_free(target); +}