Skip to content

Commit eb23096

Browse files
authored
clarified the ins and outs of the --since flag on the logs cli command (#340)
<span data-mesa-description="start"></span> ## TL;DR Clarified the `--since` flag's description for the `logs` CLI command, specifying supported formats and maximum lookback period. ## Why we made these changes To improve user clarity and reduce confusion regarding the accepted duration formats (e.g., 'd' for days vs. 'h' for hours) and the effective maximum lookback period for the `logs --since` flag. ## What changed? - **packages/cli/cmd/logs.go**: Updated the `--since` flag's help text to clearly define supported duration and timestamp formats, explicitly stating that 'd' for days is not supported and advising the use of hours instead. The maximum lookback period was also adjusted to 167 hours. ## Validation - [ ] Verified `cli logs --help` output shows the updated and clarified description for the `--since` flag. - [ ] Confirmed the CLI correctly handles `--since` values within the new 167-hour limit and rejects unsupported formats (like '1d'). <span data-mesa-description="end"></span>
1 parent 50d8e47 commit eb23096

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

cmd/logs.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ var logsCmd = &cobra.Command{
2020
func init() {
2121
logsCmd.Flags().String("version", "latest", "Specify a version of the app (default: latest)")
2222
logsCmd.Flags().BoolP("follow", "f", false, "Follow logs in real-time (stream continuously)")
23-
logsCmd.Flags().String("since", "s", "How far back to retrieve logs (e.g., 5m, 1h). Defaults to 5m if not following, 5s if following. Can also specify timestamps in formats: 2006-01-02 (day), 2006-01-02T15:04 (minute), 2006-01-02T15:04:05 (second), 2006-01-02T15:04:05.000 (ms), 2006-01-02T15:04:05.000000000 (ns). Maximum is 7d.")
23+
logsCmd.Flags().String("since", "s", "How far back to retrieve logs. Supports duration formats: ns, us, ms, s, m, h (e.g., 5m, 2h, 1h30m). Note: 'd' for days is NOT supported - use hours instead. Can also specify timestamps: 2006-01-02 (day), 2006-01-02T15:04 (minute), 2006-01-02T15:04:05 (second), 2006-01-02T15:04:05.000 (ms). Maximum lookback is 167h (just under 7 days). Defaults to 5m if not following, 5s if following.")
2424
logsCmd.Flags().Bool("with-timestamps", false, "Include timestamps in each log line")
2525
rootCmd.AddCommand(logsCmd)
2626
}

0 commit comments

Comments
 (0)