diff options
author | OpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com> | 2022-04-04 13:43:27 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-04-04 13:43:27 -0400 |
commit | 330205ebed7b4e196fbc20788440e409464e267a (patch) | |
tree | 700c5035410f351b7156ea447fa332e4edd06d3f /cmd | |
parent | 4f31ade2b251514992dec7cfe9444dd0c62f00b5 (diff) | |
parent | c185d8c0d6774e90f64f4c6a84270c20a9325944 (diff) | |
download | podman-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 'cmd')
-rw-r--r-- | cmd/podman/containers/logs.go | 3 | ||||
-rw-r--r-- | cmd/podman/pods/logs.go | 2 |
2 files changed, 5 insertions, 0 deletions
diff --git a/cmd/podman/containers/logs.go b/cmd/podman/containers/logs.go index 8b08a6313..374bf6b1c 100644 --- a/cmd/podman/containers/logs.go +++ b/cmd/podman/containers/logs.go @@ -64,6 +64,7 @@ var ( ValidArgsFunction: logsCommand.ValidArgsFunction, Example: `podman container logs ctrID podman container logs --names ctrID1 ctrID2 + podman container logs --color --names ctrID1 ctrID2 podman container logs --tail 2 mywebserver podman container logs --follow=true --since 10m ctrID podman container logs mywebserver mydbserver`, @@ -112,7 +113,9 @@ func logsFlags(cmd *cobra.Command) { _ = cmd.RegisterFlagCompletionFunc(tailFlagName, completion.AutocompleteNone) flags.BoolVarP(&logsOptions.Timestamps, "timestamps", "t", false, "Output the timestamps in the log") + flags.BoolVarP(&logsOptions.Colors, "color", "", false, "Output the containers with different colors in the log.") flags.BoolVarP(&logsOptions.Names, "names", "n", false, "Output the container name in the log") + flags.SetInterspersed(false) _ = flags.MarkHidden("details") } diff --git a/cmd/podman/pods/logs.go b/cmd/podman/pods/logs.go index e35b48bed..28e7b7a43 100644 --- a/cmd/podman/pods/logs.go +++ b/cmd/podman/pods/logs.go @@ -89,6 +89,8 @@ func logsFlags(cmd *cobra.Command) { flags.BoolVarP(&logsPodOptions.Names, "names", "n", false, "Output container names instead of container IDs in the log") flags.BoolVarP(&logsPodOptions.Timestamps, "timestamps", "t", false, "Output the timestamps in the log") + flags.BoolVarP(&logsPodOptions.Colors, "color", "", false, "Output the containers within a pod with different colors in the log") + flags.SetInterspersed(false) _ = flags.MarkHidden("details") } |