summaryrefslogtreecommitdiff
path: root/pkg/domain
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2022-04-04 13:43:27 -0400
committerGitHub <noreply@github.com>2022-04-04 13:43:27 -0400
commit330205ebed7b4e196fbc20788440e409464e267a (patch)
tree700c5035410f351b7156ea447fa332e4edd06d3f /pkg/domain
parent4f31ade2b251514992dec7cfe9444dd0c62f00b5 (diff)
parentc185d8c0d6774e90f64f4c6a84270c20a9325944 (diff)
downloadpodman-330205ebed7b4e196fbc20788440e409464e267a.tar.gz
podman-330205ebed7b4e196fbc20788440e409464e267a.tar.bz2
podman-330205ebed7b4e196fbc20788440e409464e267a.zip
Merge pull request #13490 from gcalin/13266
pod logs enhancements: option to color logs
Diffstat (limited to 'pkg/domain')
-rw-r--r--pkg/domain/entities/containers.go2
-rw-r--r--pkg/domain/entities/pods.go3
-rw-r--r--pkg/domain/infra/abi/containers.go1
3 files changed, 6 insertions, 0 deletions
diff --git a/pkg/domain/entities/containers.go b/pkg/domain/entities/containers.go
index 79795a221..072514d0f 100644
--- a/pkg/domain/entities/containers.go
+++ b/pkg/domain/entities/containers.go
@@ -257,6 +257,8 @@ type ContainerLogsOptions struct {
Tail int64
// Show timestamps in the logs.
Timestamps bool
+ // Show different colors in the logs.
+ Colors bool
// Write the stdout to this Writer.
StdoutWriter io.Writer
// Write the stderr to this Writer.
diff --git a/pkg/domain/entities/pods.go b/pkg/domain/entities/pods.go
index 8406ca019..f1d445c4b 100644
--- a/pkg/domain/entities/pods.go
+++ b/pkg/domain/entities/pods.go
@@ -149,6 +149,8 @@ type PodLogsOptions struct {
ContainerLogsOptions
// If specified will only fetch the logs of specified container
ContainerName string
+ // Show different colors in the logs.
+ Color bool
}
type ContainerCreateOptions struct {
@@ -482,6 +484,7 @@ func PodLogsOptionsToContainerLogsOptions(options PodLogsOptions) ContainerLogsO
Until: options.Until,
Tail: options.Tail,
Timestamps: options.Timestamps,
+ Colors: options.Colors,
StdoutWriter: options.StdoutWriter,
StderrWriter: options.StderrWriter,
}
diff --git a/pkg/domain/infra/abi/containers.go b/pkg/domain/infra/abi/containers.go
index a2933a267..100842c69 100644
--- a/pkg/domain/infra/abi/containers.go
+++ b/pkg/domain/infra/abi/containers.go
@@ -1088,6 +1088,7 @@ func (ic *ContainerEngine) ContainerLogs(ctx context.Context, containers []strin
Until: options.Until,
Tail: options.Tail,
Timestamps: options.Timestamps,
+ Colors: options.Colors,
UseName: options.Names,
WaitGroup: &wg,
}