summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKevin Ernst <ernstki@mail.uc.edu>2024-01-12 14:31:18 -0500
committerGitHub <noreply@github.com>2024-01-12 14:31:18 -0500
commitcd115c44e9d4b68c3f098946b59bad30dccd9ac6 (patch)
tree5c2ed2428b1cc0e69f6081c2af573590d15aca46
parent3a37defc82e77c70c9956133eceb635360630379 (diff)
Add example and help for gum log --time option to README (#472)
* docs(log): add help for `--time` option The `gum log --help` output for `--time` option says ``` -t, --time="" The time format to use (kitchen, layout, ansic, rfc822, etc...) ``` with no indication of what `etc...` means. This is probably inferred for proficient Go programmers, but not for everyone else. This commit makes it clearer which options are supported by `--time` by linking to the docs for the `time` library, * Update README.md * Update README.md --------- Co-authored-by: Maas Lalani <maas@lalani.dev>
-rw-r--r--README.md5
1 files changed, 5 insertions, 0 deletions
diff --git a/README.md b/README.md
index 00fa6ab..5d6b670 100644
--- a/README.md
+++ b/README.md
@@ -393,8 +393,13 @@ gum log --structured --level debug "Creating file..." name file.txt
# Log some error.
gum log --structured --level error "Unable to create file." name file.txt
# ERROR Unable to create file. name=temp.txt
+
+# Include a timestamp.
+gum log --time rfc822 --level error "Unable to create file."
```
+See the Go [`time` package](https://pkg.go.dev/time#pkg-constants) for acceptable `--time` formats.
+
See [`charmbracelet/log`](https://github.com/charmbracelet/log) for more usage.
<img src="https://vhs.charm.sh/vhs-6jupuFM0s2fXiUrBE0I1vU.gif" width="600" alt="Running gum log with debug and error levels" />