summaryrefslogtreecommitdiff
path: root/libpod/container_log_linux.go
diff options
context:
space:
mode:
authorgcalin <caling@protonmail.com>2022-03-04 19:04:58 +0100
committergcalin <caling@protonmail.com>2022-03-29 17:29:13 +0200
commitc185d8c0d6774e90f64f4c6a84270c20a9325944 (patch)
treed6500e6d9d740cb9a60772b86cc01b4b00a33c38 /libpod/container_log_linux.go
parent0eff4b70d0429c0dd1d95bc0a15f679cef351cb5 (diff)
downloadpodman-c185d8c0d6774e90f64f4c6a84270c20a9325944.tar.gz
podman-c185d8c0d6774e90f64f4c6a84270c20a9325944.tar.bz2
podman-c185d8c0d6774e90f64f4c6a84270c20a9325944.zip
Add option for pod logs to display different colors per container.
Signed-off-by: Krzysztof Baran <krysbaran@gmail.com> Signed-off-by: gcalin <caling@protonmail.com>
Diffstat (limited to 'libpod/container_log_linux.go')
-rw-r--r--libpod/container_log_linux.go3
1 files changed, 2 insertions, 1 deletions
diff --git a/libpod/container_log_linux.go b/libpod/container_log_linux.go
index 8ae8ff2c0..d96647e51 100644
--- a/libpod/container_log_linux.go
+++ b/libpod/container_log_linux.go
@@ -45,7 +45,7 @@ func (c *Container) initializeJournal(ctx context.Context) error {
return journal.Send("", journal.PriInfo, m)
}
-func (c *Container) readFromJournal(ctx context.Context, options *logs.LogOptions, logChannel chan *logs.LogLine) error {
+func (c *Container) readFromJournal(ctx context.Context, options *logs.LogOptions, logChannel chan *logs.LogLine, colorID int64) error {
// We need the container's events in the same journal to guarantee
// consistency, see #10323.
if options.Follow && c.runtime.config.Engine.EventsLogger != "journald" {
@@ -231,6 +231,7 @@ func (c *Container) readFromJournal(ctx context.Context, options *logs.LogOption
}
logLine, err := logs.NewJournaldLogLine(message, options.Multi)
+ logLine.ColorID = colorID
if err != nil {
logrus.Errorf("Failed parse log line: %v", err)
return