From 8b3736bf3f3980ee201a7a420136b24bd1c1fc0d Mon Sep 17 00:00:00 2001 From: Luca Boccassi Date: Tue, 22 May 2018 12:22:00 +0100 Subject: [PATCH] journalctl: add with-unit mode When dealing with a large number of template instances, for example when launching daemons per VRF, it is hard for operators to correlate log lines to arguments. Add a new with-unit mode which, if available, prefixes unit and user unit names when displaying its log messages instead of the syslog identifier. It will also use the full timestamp with timezones, like the short-full mode. --- src/shared/output-mode.c | 3 ++- src/shared/output-mode.h | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/shared/output-mode.c b/src/shared/output-mode.c index 89be1d68a..1bb161794 100644 --- a/src/shared/output-mode.c +++ b/src/shared/output-mode.c @@ -21,7 +21,8 @@ static const char *const output_mode_table[_OUTPUT_MODE_MAX] = { [OUTPUT_JSON] = "json", [OUTPUT_JSON_PRETTY] = "json-pretty", [OUTPUT_JSON_SSE] = "json-sse", - [OUTPUT_CAT] = "cat" + [OUTPUT_CAT] = "cat", + [OUTPUT_WITH_UNIT] = "with-unit", }; DEFINE_STRING_TABLE_LOOKUP(output_mode, OutputMode); diff --git a/src/shared/output-mode.h b/src/shared/output-mode.h index 3aa7b295e..a44d52867 100644 --- a/src/shared/output-mode.h +++ b/src/shared/output-mode.h @@ -23,6 +23,7 @@ typedef enum OutputMode { OUTPUT_JSON_PRETTY, OUTPUT_JSON_SSE, OUTPUT_CAT, + OUTPUT_WITH_UNIT, _OUTPUT_MODE_MAX, _OUTPUT_MODE_INVALID = -1 } OutputMode; -- 2.30.2