aboutsummaryrefslogtreecommitdiff
path: root/libpod
diff options
context:
space:
mode:
authorXueyuan Chen <x.chen-47@student.tudelft.nl>2022-02-26 23:07:25 +0100
committerXueyuan Chen <X.Chen-47@student.tudelft.nl>2022-03-01 00:18:39 +0100
commit40c6192e9e3da7f2f3f54365c89b4b837ed74fd8 (patch)
treeb3e4505fbcac2d9e9f2ec99bf4401d56483f7546 /libpod
parentc39dffe83db9fa3cfa6897b971956821f1bbcce2 (diff)
downloadpodman-40c6192e9e3da7f2f3f54365c89b4b837ed74fd8.tar.gz
podman-40c6192e9e3da7f2f3f54365c89b4b837ed74fd8.tar.bz2
podman-40c6192e9e3da7f2f3f54365c89b4b837ed74fd8.zip
Add the names flag for pod logs
Fixes containers#13261 Signed-off-by: Xueyuan Chen <X.Chen-47@student.tudelft.nl>
Diffstat (limited to 'libpod')
-rw-r--r--libpod/container_log_linux.go7
1 files changed, 5 insertions, 2 deletions
diff --git a/libpod/container_log_linux.go b/libpod/container_log_linux.go
index 6150973ca..8ae8ff2c0 100644
--- a/libpod/container_log_linux.go
+++ b/libpod/container_log_linux.go
@@ -1,5 +1,5 @@
-//+build linux
-//+build systemd
+//go:build linux && systemd
+// +build linux,systemd
package libpod
@@ -235,6 +235,9 @@ func (c *Container) readFromJournal(ctx context.Context, options *logs.LogOption
logrus.Errorf("Failed parse log line: %v", err)
return
}
+ if options.UseName {
+ logLine.CName = c.Name()
+ }
if doTail {
tailQueue = append(tailQueue, logLine)
continue