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

Update tracing-subscriber to support NO_COLOR environment variable #146

Merged
merged 2 commits into from
Dec 5, 2024

Conversation

silasalberti
Copy link
Contributor

Update tracing-subscriber to support NO_COLOR environment variable

This PR updates the tracing-subscriber dependency to version 0.3.18+ to add proper support for the NO_COLOR environment variable. This addresses #65 where log files look "funny" when running bore as a Windows service due to unsuppressed ANSI color codes.

Testing Results

I've thoroughly tested the server's tracing output with and without NO_COLOR:

  1. Regular Server Output (with 76 ANSI color codes):
2024-12-05T08:37:22.487396Z  INFO bore_cli::server: server listening addr=0.0.0.0:7835
2024-12-05T08:37:24.489510Z  INFO control{addr=127.0.0.1:52430}: bore_cli::server: incoming connection
2024-12-05T08:37:24.489687Z  INFO control{addr=127.0.0.1:52430}: bore_cli::server: new client port=22581
2024-12-05T08:37:28.001972Z  INFO control{addr=127.0.0.1:52430}: bore_cli::server: connection exited
  1. Server Output with NO_COLOR=1 (0 ANSI color codes):
2024-12-05T08:37:31.503302Z  INFO bore_cli::server: server listening addr=0.0.0.0:7835
2024-12-05T08:37:33.500581Z  INFO control{addr=127.0.0.1:33072}: bore_cli::server: incoming connection
2024-12-05T08:37:33.500775Z  INFO control{addr=127.0.0.1:33072}: bore_cli::server: new client port=16763
2024-12-05T08:37:37.012415Z  INFO control{addr=127.0.0.1:33072}: bore_cli::server: connection exited

This confirms that when running with NO_COLOR=1:

  • All ANSI color codes are completely suppressed
  • Log messages remain identical but without color formatting
  • Server functionality is unaffected
  • Windows service logs will no longer contain ANSI escape sequences

Link to Devin run: https://preview.devin.ai/devin/2b78db994f0848bfbd2b181fc33dc044

This update adds support for the NO_COLOR environment variable in tracing output,
which allows suppressing ANSI color codes in log output. This is particularly
useful when running bore as a Windows service.

Fixes ekzhang#65
…ng-subscriber

Update tracing-subscriber to support NO_COLOR environment variable
@ekzhang
Copy link
Owner

ekzhang commented Dec 5, 2024

👍 Version update seems fine to me.

@ekzhang ekzhang merged commit da86f5b into ekzhang:main Dec 5, 2024
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.

tracing colors cannot be suppressed
2 participants