aboutsummaryrefslogtreecommitdiffstats
path: root/shell/main.c
diff options
context:
space:
mode:
Diffstat (limited to 'shell/main.c')
-rw-r--r--shell/main.c18
1 files changed, 17 insertions, 1 deletions
diff --git a/shell/main.c b/shell/main.c
index c111b9faf1..dce135d9d9 100644
--- a/shell/main.c
+++ b/shell/main.c
@@ -22,6 +22,7 @@
*/
#include <config.h>
+#include <fcntl.h>
#include <glib.h>
#include <gtk/gtkmain.h>
#include <gtk/gtklabel.h>
@@ -50,6 +51,7 @@
static EShell *shell = NULL;
static char *evolution_directory = NULL;
static gboolean no_splash = FALSE;
+char *debug_log = NULL;
static void
@@ -180,7 +182,8 @@ int
main (int argc, char **argv)
{
struct poptOption options[] = {
- { "no-splash", '\0', POPT_ARG_NONE, &no_splash, 0, N_("Disable."), NULL },
+ { "no-splash", '\0', POPT_ARG_NONE, &no_splash, 0, N_("Disable splash screen"), NULL },
+ { "debug", '\0', POPT_ARG_STRING, &debug_log, 0, N_("Send the debugging output of all components to a file."), NULL },
{ NULL, '\0', POPT_ARG_INCLUDE_TABLE, &oaf_popt_options, 0, NULL, NULL },
POPT_AUTOHELP
{ NULL, '\0', 0, NULL, 0, NULL, NULL }
@@ -190,6 +193,19 @@ main (int argc, char **argv)
textdomain (PACKAGE);
gnome_init_with_popt_table ("Evolution", VERSION, argc, argv, options, 0, NULL);
+
+ if (debug_log) {
+ int fd;
+
+ fd = open (debug_log, O_WRONLY | O_CREAT | O_TRUNC, 0600);
+ if (fd) {
+ dup2 (fd, STDOUT_FILENO);
+ dup2 (fd, STDERR_FILENO);
+ close (fd);
+ } else
+ g_warning ("Could not set up debugging output file.");
+ }
+
oaf_init (argc, argv);
glade_gnome_init ();