From cd115c44e9d4b68c3f098946b59bad30dccd9ac6 Mon Sep 17 00:00:00 2001 From: Kevin Ernst Date: Fri, 12 Jan 2024 14:31:18 -0500 Subject: [PATCH] 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 --- README.md | 5 +++++ 1 file changed, 5 insertions(+) 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. Running gum log with debug and error levels