summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuca Boccassi <bluca@debian.org>2018-05-22 12:22:00 +0100
committerSven Eden <yamakuzure@gmx.net>2018-08-24 16:47:08 +0200
commit8b3736bf3f3980ee201a7a420136b24bd1c1fc0d (patch)
tree256cd79f1aa98a1099c7e0cf537a0724c5bb7bf2
parent0dab96c1afd1778dd9f1a2c7217ecdfe6dd95614 (diff)
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.
-rw-r--r--src/shared/output-mode.c3
-rw-r--r--src/shared/output-mode.h1
2 files changed, 3 insertions, 1 deletions
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;