comparison audacious/main.c @ 1348:cc57f7545876 trunk

[svn] - add --no-log switch to disable the system logger (and instead dump to stdout)
author nenolod
date Wed, 28 Jun 2006 12:51:43 -0700
parents 8a874906535b
children 0c41255487ee
comparison
equal deleted inserted replaced
1347:8a874906535b 1348:cc57f7545876
91 gint session; 91 gint session;
92 gboolean play, stop, pause, fwd, rew, play_pause, playcd; 92 gboolean play, stop, pause, fwd, rew, play_pause, playcd;
93 gboolean enqueue, mainwin, remote, activate; 93 gboolean enqueue, mainwin, remote, activate;
94 gboolean load_skins; 94 gboolean load_skins;
95 gboolean headless; 95 gboolean headless;
96 gboolean no_log;
96 gchar *previous_session_id; 97 gchar *previous_session_id;
97 }; 98 };
98 99
99 typedef struct _BmpCmdLineOpt BmpCmdLineOpt; 100 typedef struct _BmpCmdLineOpt BmpCmdLineOpt;
100 101
719 /* -i, --sm-client-id switch */ 720 /* -i, --sm-client-id switch */
720 g_print(_("Previous session ID")); 721 g_print(_("Previous session ID"));
721 g_print("\n-H, --headless "); 722 g_print("\n-H, --headless ");
722 /* -h, --headless switch */ 723 /* -h, --headless switch */
723 g_print(_("Headless operation [experimental]")); 724 g_print(_("Headless operation [experimental]"));
725 g_print("\n-N, --no-log ");
726 /* -N, --no-log switch */
727 g_print(_("Disable error/warning interception (logging)"));
724 g_print("\n-v, --version "); 728 g_print("\n-v, --version ");
725 /* -v, --version switch */ 729 /* -v, --version switch */
726 g_print(_("Print version number and exit\n")); 730 g_print(_("Print version number and exit\n"));
727 731
728 exit(EXIT_SUCCESS); 732 exit(EXIT_SUCCESS);
747 {"activate", 0, NULL, 'a'}, 751 {"activate", 0, NULL, 'a'},
748 {"version", 0, NULL, 'v'}, 752 {"version", 0, NULL, 'v'},
749 {"sm-client-id", 1, NULL, 'i'}, 753 {"sm-client-id", 1, NULL, 'i'},
750 {"xmms", 0, NULL, 'x'}, 754 {"xmms", 0, NULL, 'x'},
751 {"headless", 0, NULL, 'H'}, 755 {"headless", 0, NULL, 'H'},
756 {"no-log", 0, NULL, 'N'},
752 {0, 0, 0, 0} 757 {0, 0, 0, 0}
753 }; 758 };
754 759
755 gchar *filename, *current_dir; 760 gchar *filename, *current_dir;
756 gint c, i; 761 gint c, i;
807 case 'c': 812 case 'c':
808 options->playcd = TRUE; 813 options->playcd = TRUE;
809 break; 814 break;
810 case 'S': 815 case 'S':
811 options->load_skins = TRUE; 816 options->load_skins = TRUE;
817 break;
818 case 'N':
819 options->no_log = TRUE;
812 break; 820 break;
813 } 821 }
814 } 822 }
815 823
816 current_dir = g_get_current_dir(); 824 current_dir = g_get_current_dir();
965 bind_textdomain_codeset(PACKAGE_NAME, "UTF-8"); 973 bind_textdomain_codeset(PACKAGE_NAME, "UTF-8");
966 textdomain(PACKAGE_NAME); 974 textdomain(PACKAGE_NAME);
967 975
968 bmp_init_paths(); 976 bmp_init_paths();
969 bmp_make_user_dir(); 977 bmp_make_user_dir();
970 bmp_setup_logger();
971 978
972 /* Check GTK version. Really, this is only needed for binary 979 /* Check GTK version. Really, this is only needed for binary
973 * distribution since configure already checks. */ 980 * distribution since configure already checks. */
974 if (!GTK_CHECK_VERSION(2, 6, 0)) { 981 if (!GTK_CHECK_VERSION(2, 6, 0)) {
975 g_printerr(_("Sorry, your GTK+ version (%d.%d.%d) does not work with Audacious.\n" 982 g_printerr(_("Sorry, your GTK+ version (%d.%d.%d) does not work with Audacious.\n"
1008 /* we could be running headless, so GTK probably wont matter */ 1015 /* we could be running headless, so GTK probably wont matter */
1009 if (options.headless != 1) 1016 if (options.headless != 1)
1010 exit(EXIT_SUCCESS); 1017 exit(EXIT_SUCCESS);
1011 } 1018 }
1012 1019
1020 if (options.no_log == FALSE)
1021 bmp_setup_logger();
1022
1013 if (!vfs_init()) { 1023 if (!vfs_init()) {
1014 g_printerr(Q_("Could not initialize VFS.\n")); 1024 g_printerr(Q_("Could not initialize VFS.\n"));
1015 exit(EXIT_FAILURE); 1025 exit(EXIT_FAILURE);
1016 } 1026 }
1017 1027