Set log level earlier

Signed-off-by: Sebastian Ramacher <sebastian+dev@ramacher.at>
This commit is contained in:
Sebastian Ramacher 2013-12-24 01:41:43 +01:00
parent f5983a8429
commit 03e1fb1f90

18
main.c
View File

@ -85,6 +85,15 @@ main(int argc, char* argv[])
}
g_option_context_free(context);
/* Set log level. */
if (loglevel == NULL || g_strcmp0(loglevel, "info") == 0) {
girara_set_debug_level(GIRARA_INFO);
} else if (g_strcmp0(loglevel, "warning") == 0) {
girara_set_debug_level(GIRARA_WARNING);
} else if (g_strcmp0(loglevel, "error") == 0) {
girara_set_debug_level(GIRARA_ERROR);
}
if (synctex_fwd != NULL) {
if (argc != 2) {
girara_error(_("Too many arguments or missing filename while running with --syntex-forward"));
@ -109,15 +118,6 @@ main(int argc, char* argv[])
setsid();
}
/* Set log level. */
if (loglevel == NULL || g_strcmp0(loglevel, "info") == 0) {
girara_set_debug_level(GIRARA_INFO);
} else if (g_strcmp0(loglevel, "warning") == 0) {
girara_set_debug_level(GIRARA_WARNING);
} else if (g_strcmp0(loglevel, "error") == 0) {
girara_set_debug_level(GIRARA_ERROR);
}
zathura_set_xid(zathura, embed);
zathura_set_config_dir(zathura, config_dir);
zathura_set_data_dir(zathura, data_dir);