about summary refs log tree commit diff stats
path: root/src/log.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/log.c')
-rw-r--r--src/log.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/log.c b/src/log.c
index cb346e6c..b30c68cb 100644
--- a/src/log.c
+++ b/src/log.c
@@ -37,6 +37,7 @@
 #define PROF "prof"
 
 static FILE *logp;
+GString *mainlogfile;
 
 static GTimeZone *tz;
 static GDateTime *dt;
@@ -120,6 +121,7 @@ log_init(log_level_t filter)
     tz = g_time_zone_new_local();
     gchar *log_file = _get_main_log_file();
     logp = fopen(log_file, "a");
+    mainlogfile = g_string_new(log_file);
     free(log_file);
 }
 
@@ -130,6 +132,12 @@ log_reinit(void)
     log_init(level_filter);
 }
 
+char *
+get_log_file_location(void)
+{
+    return mainlogfile->str;
+}
+
 log_level_t
 log_get_filter(void)
 {
@@ -139,6 +147,7 @@ log_get_filter(void)
 void
 log_close(void)
 {
+    g_string_free(mainlogfile, TRUE);
     g_time_zone_unref(tz);
     if (logp != NULL) {
         fclose(logp);