Man pages: refactor common options: log-related options

podman-logs and podman-pod-logs. Most of these were already
identical, needing no review. Exceptions:

  --follow : needed some container/pod tweaking. This is the
             only one that really needs careful review.

  --names  : I went with the longer version

Note that podman-events has --since and --until options too, but
those are too different to be combined here.

Signed-off-by: Ed Santiago <santiago@redhat.com>
This commit is contained in:
Ed Santiago
2022-08-24 17:38:05 -06:00
parent 9a83fe33b5
commit 0ff0fde49e
10 changed files with 48 additions and 63 deletions

View File

@ -9,11 +9,13 @@ podman-kill.1.md
podman-kube-play.1.md podman-kube-play.1.md
podman-login.1.md podman-login.1.md
podman-logout.1.md podman-logout.1.md
podman-logs.1.md
podman-manifest-add.1.md podman-manifest-add.1.md
podman-manifest-push.1.md podman-manifest-push.1.md
podman-pause.1.md podman-pause.1.md
podman-pod-clone.1.md podman-pod-clone.1.md
podman-pod-create.1.md podman-pod-create.1.md
podman-pod-logs.1.md
podman-pod-rm.1.md podman-pod-rm.1.md
podman-pod-start.1.md podman-pod-start.1.md
podman-pod-stop.1.md podman-pod-stop.1.md

View File

@ -0,0 +1,3 @@
#### **--color**
Output the containers with different colors in the log.

View File

@ -0,0 +1,7 @@
#### **--follow**, **-f**
Follow log output. Default is false.
Note: If you are following a <<container|pod>> which is removed by `podman <<container|pod>> rm`
or removed on exit (`podman run --rm ...`), then there is a chance that the log
file will be removed before `podman<< pod|>> logs` reads the final content.

View File

@ -0,0 +1,3 @@
#### **--names**, **-n**
Output the container names instead of the container IDs in the log.

View File

@ -0,0 +1,6 @@
#### **--since**=*TIMESTAMP*
Show logs since TIMESTAMP. The --since option can be Unix timestamps, date formatted timestamps, or Go duration
strings (e.g. 10m, 1h30m) computed relative to the client machine's time. Supported formats for date formatted
time stamps include RFC3339Nano, RFC3339, 2006-01-02T15:04:05, 2006-01-02T15:04:05.999999999, 2006-01-02Z07:00,
and 2006-01-02.

View File

@ -0,0 +1,4 @@
#### **--tail**=*LINES*
Output the specified number of LINES at the end of the logs. LINES must be an integer. Defaults to -1,
which prints all lines

View File

@ -0,0 +1,3 @@
#### **--timestamps**, **-t**
Show timestamps in the log outputs. The default is false

View File

@ -0,0 +1,6 @@
#### **--until**=*TIMESTAMP*
Show logs until TIMESTAMP. The --until option can be Unix timestamps, date formatted timestamps, or Go duration
strings (e.g. 10m, 1h30m) computed relative to the client machine's time. Supported formats for date formatted
time stamps include RFC3339Nano, RFC3339, 2006-01-02T15:04:05, 2006-01-02T15:04:05.999999999, 2006-01-02Z07:00,
and 2006-01-02.

View File

@ -15,49 +15,24 @@ any logs at the time you execute podman logs).
## OPTIONS ## OPTIONS
#### **--color** @@option color
Output the containers with different colors in the log. @@option follow
#### **--follow**, **-f**
Follow log output. Default is false.
Note: If you are following a container which is removed `podman container rm`
or removed on exit `podman run --rm ...`, then there is a chance that the log
file will be removed before `podman logs` reads the final content.
#### **--latest**, **-l** #### **--latest**, **-l**
Instead of providing the container name or ID, use the last created container. If you use methods other than Podman Instead of providing the container name or ID, use the last created container. If you use methods other than Podman
to run containers such as CRI-O, the last started container could be from either of those methods. (This option is not available with the remote Podman client, including Mac and Windows (excluding WSL2) machines) to run containers such as CRI-O, the last started container could be from either of those methods. (This option is not available with the remote Podman client, including Mac and Windows (excluding WSL2) machines)
#### **--names**, **-n** @@option names
Output the container name in the log @@option since
#### **--since**=*TIMESTAMP* @@option tail
Show logs since TIMESTAMP. The --since option can be Unix timestamps, date formatted timestamps, or Go duration @@option timestamps
strings (e.g. 10m, 1h30m) computed relative to the client machine's time. Supported formats for date formatted
time stamps include RFC3339Nano, RFC3339, 2006-01-02T15:04:05, 2006-01-02T15:04:05.999999999, 2006-01-02Z07:00,
and 2006-01-02.
#### **--tail**=*LINES* @@option until
Output the specified number of LINES at the end of the logs. LINES must be an integer. Defaults to -1,
which prints all lines
#### **--timestamps**, **-t**
Show timestamps in the log outputs. The default is false
#### **--until**=*TIMESTAMP*
Show logs until TIMESTAMP. The --until option can be Unix timestamps, date formatted timestamps, or Go duration
strings (e.g. 10m, 1h30m) computed relative to the client machine's time. Supported formats for date formatted
time stamps include RFC3339Nano, RFC3339, 2006-01-02T15:04:05, 2006-01-02T15:04:05.999999999, 2006-01-02Z07:00,
and 2006-01-02.
## EXAMPLE ## EXAMPLE

View File

@ -13,51 +13,27 @@ Note: Long running command of `podman pod log` with a `-f` or `--follow` needs t
## OPTIONS ## OPTIONS
#### **--color** @@option color
Output the containers with different colors in the log.
#### **--container**, **-c** #### **--container**, **-c**
By default `podman pod logs` retrieves logs for all the containers available within the pod differentiate by field `container`. However there are use-cases where user would want to limit the log stream only to a particular container of a pod for such cases `-c` can be used like `podman pod logs -c ctrNameorID podname`. By default `podman pod logs` retrieves logs for all the containers available within the pod differentiate by field `container`. However there are use-cases where user would want to limit the log stream only to a particular container of a pod for such cases `-c` can be used like `podman pod logs -c ctrNameorID podname`.
#### **--follow**, **-f** @@option follow
Follow log output. Default is false.
Note: If you are following a pod which is removed `podman pod rm`, then there is a
chance that the log file will be removed before `podman pod logs` reads the final content.
#### **--latest**, **-l** #### **--latest**, **-l**
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) 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** @@option names
Output the container names instead of the container IDs in the log. @@option since
#### **--since**=*TIMESTAMP* @@option tail
Show logs since TIMESTAMP. The --since option can be Unix timestamps, date formatted timestamps, or Go duration @@option timestamps
strings (e.g. 10m, 1h30m) computed relative to the client machine's time. Supported formats for date formatted
time stamps include RFC3339Nano, RFC3339, 2006-01-02T15:04:05, 2006-01-02T15:04:05.999999999, 2006-01-02Z07:00,
and 2006-01-02.
#### **--tail**=*LINES* @@option until
Output the specified number of LINES at the end of the logs. LINES must be an integer. Defaults to -1,
which prints all lines
#### **--timestamps**, **-t**
Show timestamps in the log outputs. The default is false
#### **--until**=*TIMESTAMP*
Show logs until TIMESTAMP. The --until option can be Unix timestamps, date formatted timestamps, or Go duration
strings (e.g. 10m, 1h30m) computed relative to the client machine's time. Supported formats for date formatted
time stamps include RFC3339Nano, RFC3339, 2006-01-02T15:04:05, 2006-01-02T15:04:05.999999999, 2006-01-02Z07:00,
and 2006-01-02.
## EXAMPLE ## EXAMPLE