From 991e274b61f489e625274254138567c9c81b4c4b Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Wed, 20 Apr 2016 20:09:57 +0200 Subject: journalctl: add --no-hostname switch This suppresses output of the hostname for messages from the local system. Fixes: #2342 --- src/shared/logs-show.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/shared/logs-show.c') diff --git a/src/shared/logs-show.c b/src/shared/logs-show.c index 5cfa455e05..cd3d53669c 100644 --- a/src/shared/logs-show.c +++ b/src/shared/logs-show.c @@ -373,6 +373,12 @@ static int output_short( n += strlen(buf); } + if (hostname && (flags & OUTPUT_NO_HOSTNAME)) { + /* Suppress display of the hostname if this is requested. */ + hostname = NULL; + hostname_len = 0; + } + if (hostname && shall_print(hostname, hostname_len, flags)) { fprintf(f, " %.*s", (int) hostname_len, hostname); n += hostname_len + 1; -- cgit v1.2.3-54-g00ecf