feat: make logs visible by default with environment variable controls#41
feat: make logs visible by default with environment variable controls#41theodorDiaconu merged 4 commits intomainfrom
Conversation
|
@theodorDiaconu 👋 This repository doesn't have Copilot instructions. With Copilot instructions, I can understand the repository better, work faster and produce higher quality PRs. I can generate a .github/copilot-instructions.md file for you automatically. Click here to open a pre-filled issue and assign it to me. I'll write the instructions, and then tag you for review. |
- Change default printThreshold from null to "info" for better DX - Add BLUELIBS_DISABLE_LOGS environment variable to disable logging - Add BLUELIBS_LOG_LEVEL environment variable to set specific log level - Maintain backward compatibility with existing setPrintThreshold() calls - Add comprehensive tests for new default behavior and environment variables Co-authored-by: theodorDiaconu <1814863+theodorDiaconu@users.noreply.github.com>
- Update Quick Start section to show which logs are visible by default - Update Print Threshold section to document environment variable controls - Add examples of BLUELIBS_DISABLE_LOGS and BLUELIBS_LOG_LEVEL usage - Clarify default behavior and programmatic overrides Co-authored-by: theodorDiaconu <1814863+theodorDiaconu@users.noreply.github.com>
|
@copilot let's use the term RUNNER for the process.env . More in-line. |
Co-authored-by: theodorDiaconu <1814863+theodorDiaconu@users.noreply.github.com>
Updated environment variables to use RUNNER_ prefix instead of BLUELIBS_:
Changes made in commit 470cf54, including updates to the implementation, tests, and documentation. |
|
Important Review skippedBot user detected. To trigger a single review, invoke the You can disable this status message by setting the 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Join our Discord community for assistance with any issues or questions. CodeRabbit Commands (Invoked using PR/Issue comments)Type Other keywords and placeholders
CodeRabbit Configuration File (
|
This PR addresses a significant developer experience issue where logs were hidden by default, making it difficult for developers to see what's happening during application startup and development.
The Problem
Previously, the Logger's
printThresholdwas set tonullby default, meaning no logs were printed to the console unless explicitly configured. This created a poor developer experience, especially during the "big bang" phase of starting new projects where visibility into what's happening is crucial.The Solution
Changed Default Behavior: Logs at
infolevel and above are now visible by default, providing immediate feedback without any configuration.Added Environment Variable Controls for elegant log management:
BLUELIBS_DISABLE_LOGS=true- Completely disable all logging outputBLUELIBS_LOG_LEVEL=debug- Set specific log level (trace, debug, info, warn, error, critical)Maintained Full Backward Compatibility: Existing applications that call
setPrintThreshold()continue to work unchanged, with manual settings overriding the new defaults.Examples
Benefits
The implementation includes comprehensive tests covering all scenarios and updated documentation reflecting the new default behavior.
Fixes #40.
💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.