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

Add cli flag to enable structured logging #1598

Merged
merged 5 commits into from
Jan 17, 2023

Conversation

rakeshsharma14317
Copy link
Contributor

No description provided.

@rakeshsharma14317 rakeshsharma14317 linked an issue Jan 12, 2023 that may be closed by this pull request
Copy link
Contributor

@begelundmuller begelundmuller left a comment

Choose a reason for hiding this comment

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

  1. In local, make logFormat an enum (unless you can think of a better approach to not pass the strings around – maybe zap has some types we could use?):
type LogFormat string

const (
  LogFormatColor = "color"
  LogFormatJSON = "json"
)

func ParseLogFormat(format string) (LogFormat, bool) {
  // ...
  1. Use ParseLogFormat for rill start. For the other commands, just always pass local.LogFormatColor.

This doesn't really belong in the local package, but let's not move logger management to a separate package now.

cli/cmd/start/start.go Outdated Show resolved Hide resolved
cli/cmd/start/start.go Outdated Show resolved Hide resolved
cli/pkg/local/app.go Outdated Show resolved Hide resolved
@begelundmuller begelundmuller self-requested a review January 17, 2023 15:12
@begelundmuller begelundmuller merged commit 166d5fd into main Jan 17, 2023
@begelundmuller begelundmuller deleted the 1596-add-cli-flag-to-enable-structured-logging branch January 17, 2023 15:13
bcolloran pushed a commit that referenced this pull request Mar 7, 2023
* add logging format flag to cli

* adding enum for log format

* review changes

* Review

Co-authored-by: Benjamin Egelund-Müller <b@egelund-muller.com>
djbarnwal pushed a commit that referenced this pull request Aug 3, 2023
* add logging format flag to cli

* adding enum for log format

* review changes

* Review

Co-authored-by: Benjamin Egelund-Müller <b@egelund-muller.com>
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.

Add CLI flag to enable structured logging
2 participants