summaryrefslogtreecommitdiffstats
path: root/src/plugins/abrt-action-bugzilla.cpp
diff options
context:
space:
mode:
authorDenys Vlasenko <dvlasenk@redhat.com>2011-03-25 00:33:43 +0100
committerDenys Vlasenko <dvlasenk@redhat.com>2011-03-25 00:33:43 +0100
commit46f706319695dc77d66ab5f7cbc5cbdcad707366 (patch)
treeaf8580044be2aac9066c034128ec52c3ce8d198f /src/plugins/abrt-action-bugzilla.cpp
parentb42449a7d77e649046a05ca82e2f6fa464bff3ca (diff)
downloadabrt-46f706319695dc77d66ab5f7cbc5cbdcad707366.tar.gz
abrt-46f706319695dc77d66ab5f7cbc5cbdcad707366.tar.xz
abrt-46f706319695dc77d66ab5f7cbc5cbdcad707366.zip
make $ABRT_PROG_PREFIX control whether log messages are prefixed
by abrt-action-foo programs. abrtd, abrt-server and abrt-handle-crashdump now have option -p which sets ABRT_PROG_PREFIX=1 for their children and thus makes them emit program name prefixes. Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
Diffstat (limited to 'src/plugins/abrt-action-bugzilla.cpp')
-rw-r--r--src/plugins/abrt-action-bugzilla.cpp25
1 files changed, 10 insertions, 15 deletions
diff --git a/src/plugins/abrt-action-bugzilla.cpp b/src/plugins/abrt-action-bugzilla.cpp
index 79e83b3b..abc3fa1a 100644
--- a/src/plugins/abrt-action-bugzilla.cpp
+++ b/src/plugins/abrt-action-bugzilla.cpp
@@ -908,34 +908,29 @@ int main(int argc, char **argv)
/* Can't keep these strings/structs static: _() doesn't support that */
const char *program_usage_string = _(
- PROGNAME" [-vs] -c CONFFILE -d DIR"
+ PROGNAME" [-v] -c CONFFILE -d DIR\n"
"\n"
- "\nReport a crash to Bugzilla"
+ "Reports problem to Bugzilla"
);
enum {
OPT_v = 1 << 0,
- OPT_s = 1 << 1,
- OPT_d = 1 << 2,
- OPT_c = 1 << 3,
+ OPT_d = 1 << 1,
+ OPT_c = 1 << 2,
};
/* Keep enum above and order of options below in sync! */
struct options program_options[] = {
OPT__VERBOSE(&g_verbose),
- OPT_BOOL( 's', NULL, NULL , _("Log to syslog")),
- OPT_STRING('d', NULL, &dump_dir_name, "DIR" , _("Crash dump directory")),
+ OPT_STRING('d', NULL, &dump_dir_name, "DIR" , _("Dump directory")),
OPT_LIST( 'c', NULL, &conf_file , "FILE", _("Configuration file (may be given many times)")),
OPT_END()
};
- unsigned opts = parse_opts(argc, argv, program_options, program_usage_string);
+ /*unsigned opts =*/ parse_opts(argc, argv, program_options, program_usage_string);
putenv(xasprintf("ABRT_VERBOSE=%u", g_verbose));
-//DONT! our stdout/stderr goes directly to daemon, don't want to have prefix there.
-// msg_prefix = xasprintf(PROGNAME"[%u]", getpid());
- if (opts & OPT_s)
- {
- openlog(msg_prefix, 0, LOG_DAEMON);
- logmode = LOGMODE_SYSLOG;
- }
+
+ char *pfx = getenv("ABRT_PROG_PREFIX");
+ if (pfx && string_to_bool(pfx))
+ msg_prefix = PROGNAME;
while (conf_file)
{