diff options
Diffstat (limited to 'src/shared')
-rw-r--r-- | src/shared/logs-show.c | 6 | ||||
-rw-r--r-- | src/shared/output-mode.h | 1 |
2 files changed, 7 insertions, 0 deletions
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; diff --git a/src/shared/output-mode.h b/src/shared/output-mode.h index 56fd3ba8e3..f37189e57f 100644 --- a/src/shared/output-mode.h +++ b/src/shared/output-mode.h @@ -50,6 +50,7 @@ typedef enum OutputFlags { OUTPUT_BEGIN_NEWLINE = 1 << 6, OUTPUT_UTC = 1 << 7, OUTPUT_KERNEL_THREADS = 1 << 8, + OUTPUT_NO_HOSTNAME = 1 << 9, } OutputFlags; const char* output_mode_to_string(OutputMode m) _const_; |