Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CLI Refresh: Output improvements on start-dev #441

Merged
merged 2 commits into from
Feb 12, 2024
Merged

Conversation

cretz
Copy link
Member

@cretz cretz commented Feb 10, 2024

What was changed

Now when you run temporal server start-dev, this is the output:

Temporal server is running at: localhost:7233
Web UI is running at: http://localhost:8233

(many suggestions came from @lorensr)

@cretz cretz requested a review from a team February 10, 2024 00:34
s.Command.Flags().StringVar(&s.UiIp, "ui-ip", "", "IP address to bind the Web UI to. Default is same as --ip.")
s.Command.Flags().StringVar(&s.UiAssetPath, "ui-asset-path", "", "UI custom assets path.")
s.Command.Flags().StringVar(&s.UiCodecEndpoint, "ui-codec-endpoint", "", "UI remote codec HTTP endpoint.")
s.Command.Flags().StringArrayVar(&s.SqlitePragma, "sqlite-pragma", nil, "Specify SQLite pragma statements in pragma=value format.")
s.Command.Flags().StringArrayVar(&s.DynamicConfigValue, "dynamic-config-value", nil, "Dynamic config value, as KEY=JSON_VALUE (string values need quotes).")
s.Command.Flags().BoolVar(&s.LogConfig, "log-config", false, "Log the server config being used in stderr.")
s.LogLevelServer = NewStringEnum([]string{"debug", "info", "warn", "error", "off"}, "warn")
s.Command.Flags().Var(&s.LogLevelServer, "log-level-server", "Log level for the server only.")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not related to this PR but I think it would be nice to show the user the available alternative enum values

      --log-level-server string            Log level for the server only. (default "warn")

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does --log-level off have precedent elsewhere in Temporal/Go? If so then fine; if not, then I'll also throw in --log-level never as a candidate, since it's sort of consistent gramatically: debug, info, warn, error, never.

Copy link
Member Author

@cretz cretz Feb 12, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not related to this PR but I think it would be nice to show the user the available alternative enum values

Agreed. We currently have a general concept of trailing options attribute sentences being removed from the English part, and Cobra doesn't support any kind of enum listing. So we can, at code writing time, append the "Accepted values: <values...>" for all enums.

Does --log-level off have precedent elsewhere in Temporal/Go?

No, only here I think, so I'd support changing this to never for sure.

I can open a PR for both of these shortly...

Copy link
Contributor

@dandavison dandavison left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@cretz cretz merged commit 4bd0da1 into cli-rewrite Feb 12, 2024
5 checks passed
@cretz cretz deleted the reduce-srv-log branch February 12, 2024 16:23
@dandavison
Copy link
Contributor

This is a huge improvement.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants