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-print.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-print.c')
-rw-r--r-- | src/plugins/abrt-action-print.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/plugins/abrt-action-print.c b/src/plugins/abrt-action-print.c index f34fd014..be2179a5 100644 --- a/src/plugins/abrt-action-print.c +++ b/src/plugins/abrt-action-print.c @@ -38,7 +38,7 @@ int main(int argc, char **argv) const char *program_usage_string = _( PROGNAME" [-v] -d DIR [-o FILE] [-a yes/no]\n" "\n" - "Print problem information to standard output or FILE" + "Prints problem information to standard output or FILE" ); enum { OPT_v = 1 << 0, @@ -57,7 +57,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; + + char *pfx = getenv("ABRT_PROG_PREFIX"); + if (pfx && string_to_bool(pfx)) + msg_prefix = PROGNAME; if (output_file) { |