summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMichael Adam <obnox@samba.org>2009-12-22 12:57:49 +0100
committerMichael Adam <obnox@samba.org>2009-12-23 00:27:26 +0100
commit649b2c06830fe08cc9db5f6fdf6f05de96ed1a0b (patch)
tree964ff5cd514d4b3fa657a95a7e81df0d619b92db /src
parent479562ad2b039c511d81ba9f8750d4fe546503a0 (diff)
downloadtinyproxy-649b2c06830fe08cc9db5f6fdf6f05de96ed1a0b.tar.gz
tinyproxy-649b2c06830fe08cc9db5f6fdf6f05de96ed1a0b.zip
log: add function shutdown_logging().
Michael
Diffstat (limited to 'src')
-rw-r--r--src/log.c15
-rw-r--r--src/log.h1
2 files changed, 16 insertions, 0 deletions
diff --git a/src/log.c b/src/log.c
index 5d669b4..3b5c706 100644
--- a/src/log.c
+++ b/src/log.c
@@ -281,3 +281,18 @@ int setup_logging (void)
done:
return ret;
}
+
+/**
+ * Stop the logging subsystem.
+ */
+void shutdown_logging (void)
+{
+ if (config.logf_name) {
+ close_log_file ();
+ } else if (config.syslog) {
+ closelog ();
+ } else {
+ fprintf (stderr, "error - shutdown_logging called while "
+ " logging not configured yet\n");
+ }
+}
diff --git a/src/log.h b/src/log.h
index 4452cd1..3a6b595 100644
--- a/src/log.h
+++ b/src/log.h
@@ -118,5 +118,6 @@ extern void set_log_level (int level);
extern void send_stored_logs (void);
extern int setup_logging (void);
+extern void shutdown_logging (void);
#endif