diff options
author | Denys Vlasenko <dvlasenk@redhat.com> | 2011-03-25 00:33:43 +0100 |
---|---|---|
committer | Denys Vlasenko <dvlasenk@redhat.com> | 2011-03-25 00:33:43 +0100 |
commit | 46f706319695dc77d66ab5f7cbc5cbdcad707366 (patch) | |
tree | af8580044be2aac9066c034128ec52c3ce8d198f /src/plugins/abrt-action-upload.c | |
parent | b42449a7d77e649046a05ca82e2f6fa464bff3ca (diff) | |
download | abrt-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-upload.c')
-rw-r--r-- | src/plugins/abrt-action-upload.c | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/src/plugins/abrt-action-upload.c b/src/plugins/abrt-action-upload.c index 8556e142..beb09beb 100644 --- a/src/plugins/abrt-action-upload.c +++ b/src/plugins/abrt-action-upload.c @@ -245,7 +245,7 @@ int main(int argc, char **argv) const char *program_usage_string = _( PROGNAME" [-v] -d DIR [-c CONFFILE] [-u URL]\n" "\n" - "Upload compressed tarball of crash dump" + "Uploads compressed tarball of dump directory DIR" ); enum { OPT_v = 1 << 0, @@ -256,7 +256,7 @@ int main(int argc, char **argv) /* Keep enum above and order of options below in sync! */ struct options program_options[] = { OPT__VERBOSE(&g_verbose), - OPT_STRING('d', NULL, &dump_dir_name, "DIR" , _("Crash dump directory")), + OPT_STRING('d', NULL, &dump_dir_name, "DIR" , _("Dump directory")), OPT_STRING('c', NULL, &conf_file , "CONFFILE", _("Config file")), OPT_STRING('u', NULL, &url , "URL" , _("Base URL to upload to")), OPT_END() @@ -264,12 +264,10 @@ int main(int argc, char **argv) /*unsigned opts =*/ parse_opts(argc, argv, program_options, program_usage_string); putenv(xasprintf("ABRT_VERBOSE=%u", g_verbose)); - //msg_prefix = PROGNAME; - //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; map_string_h *settings = new_map_string(); if (url) |