Skip to content

Improve log level printing #19030

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

Merged
merged 1 commit into from
Nov 7, 2023
Merged

Improve log level printing #19030

merged 1 commit into from
Nov 7, 2023

Conversation

csweichel
Copy link
Contributor

@csweichel csweichel commented Nov 7, 2023

Description

image
Summary generated by Copilot

🤖 Generated by Copilot at ce98fdc

Improve local-app logging output and add color option. This pull request adds a --no-color flag to the local-app command to disable colored output, and uses different colors for different log levels to make them easier to distinguish.

Related Issue(s)

Fixes EXP-888

Documentation

Preview status

gitpod:summary

Build Options

Build
  • /werft with-werft
    Run the build with werft instead of GHA
  • leeway-no-cache
  • /werft no-test
    Run Leeway with --dont-test
Publish
  • /werft publish-to-npm
  • /werft publish-to-jb-marketplace
Installer
  • analytics=segment
  • with-dedicated-emulation
  • workspace-feature-flags
    Add desired feature flags to the end of the line above, space separated
Preview Environment / Integration Tests
  • /werft with-local-preview
    If enabled this will build install/preview
  • /werft with-preview
  • /werft with-large-vm
  • /werft with-gce-vm
    If enabled this will create the environment on GCE infra
  • with-integration-tests=all
    Valid options are all, workspace, webapp, ide, jetbrains, vscode, ssh. If enabled, with-preview and with-large-vm will be enabled.
  • with-monitoring

/hold

case slog.LevelDebug.String():
attr.Value = slog.StringValue(color.Gray.Render("[DEBUG]"))
case slog.LevelInfo.String():
attr.Value = slog.StringValue(color.Green.Render("[INFO ]"))
Copy link
Member

Choose a reason for hiding this comment

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

Good that we're keeping the indentation of the messages consistent with this, although it may be a bit confusing for grepping output

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It also looks a bit odd if there isn't any output that actually aligns here.
Let's run with it for now and change it if it's too odd.

@roboquat roboquat merged commit 1b90b8a into main Nov 7, 2023
@roboquat roboquat deleted the cw/eng-888 branch November 7, 2023 20:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants