Skip to content

Commit

Permalink
Add the names flag for pod logs
Browse files Browse the repository at this point in the history
Fixes containers#13261

Signed-off-by: Xueyuan Chen <X.Chen-47@student.tudelft.nl>
  • Loading branch information
keonchennl committed Feb 26, 2022
1 parent 988190d commit 3ad95b1
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions cmd/podman/pods/logs.go
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ func logsFlags(cmd *cobra.Command) {
flags.Int64Var(&logsPodOptions.Tail, tailFlagName, -1, "Output the specified number of LINES at the end of the logs.")
_ = cmd.RegisterFlagCompletionFunc(tailFlagName, completion.AutocompleteNone)

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.SetInterspersed(false)
_ = flags.MarkHidden("details")
Expand Down
4 changes: 4 additions & 0 deletions docs/source/markdown/podman-pod-logs.1.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@ chance that the log file will be removed before `podman pod logs` reads the fina

Instead of providing the pod name or id, get logs of the last created pod. (This option is not available with the remote Podman client, including Mac and Windows (excluding WSL2) machines)

#### **--names**, **-n**

Output the container names instead of the container IDs in the log

#### **--since**=*TIMESTAMP*

Show logs since TIMESTAMP. The --since option can be Unix timestamps, date formatted timestamps, or Go duration
Expand Down

0 comments on commit 3ad95b1

Please sign in to comment.