Update README
[browser-switch] / main.c
diff --git a/main.c b/main.c
index cd7fdb5..093b535 100644 (file)
--- a/main.c
+++ b/main.c
@@ -53,7 +53,7 @@ static void read_config(int signalnum) {
        FILE *fp;
        int continuous_mode_seen = 0;
        struct swb_config_line line;
-       char *default_browser = NULL;
+       char *default_browser = NULL, *logger_name = NULL;
 
        set_config_defaults(&ctx);
 
@@ -78,6 +78,9 @@ static void read_config(int signalnum) {
                        } else if (!strcmp(line.key, "other_browser_cmd")) {
                                if (!ctx.other_browser_cmd)
                                        ctx.other_browser_cmd = line.value;
+                       } else if (!strcmp(line.key, "logging")) {
+                               if (!logger_name)
+                                       logger_name = line.value;
                        } else {
                                /* Don't need this line's contents */
                                free(line.value);
@@ -87,16 +90,21 @@ static void read_config(int signalnum) {
        }
        parse_config_file_end();
 
+out:
+       fclose(fp);
+out_noopen:
+       log_config(logger_name);
+       update_default_browser(&ctx, default_browser);
+
        log_msg("continuous_mode: %d\n", ctx.continuous_mode);
        log_msg("default_browser: '%s'\n",
                default_browser?default_browser:"NULL");
        log_msg("other_browser_cmd: '%s'\n",
                ctx.other_browser_cmd?ctx.other_browser_cmd:"NULL");
+       log_msg("logging: '%s'\n",
+               logger_name?logger_name:"NULL");
 
-out:
-       fclose(fp);
-out_noopen:
-       update_default_browser(&ctx, default_browser);
+       free(logger_name);
        free(default_browser);
        return;
 }