fix(startup-log): send startup logs to stderr#7502
Conversation
Overall package sizeSelf size: 4.59 MB Dependency sizes| name | version | self size | total size | |------|---------|-----------|------------| | import-in-the-middle | 2.0.6 | 81.92 kB | 813.08 kB | | dc-polyfill | 0.1.10 | 26.73 kB | 26.73 kB |🤖 This report was automatically generated by heaviest-objects-in-the-universe |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #7502 +/- ##
=======================================
Coverage 80.28% 80.28%
=======================================
Files 731 731
Lines 31152 31152
=======================================
Hits 25009 25009
Misses 6143 6143
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
This comment has been minimized.
This comment has been minimized.
93581cf to
0979126
Compare
Changed startup logs to output to stderr (via console.warn) instead of stdout (via console.info), following Unix conventions and aligning with other Datadog language tracers. This is a minimal change that only swaps the output stream - no changes to timing or function structure. Changes: - Changed startupLog() to use warn() instead of info() for stderr output - Updated all tests to expect console.warn instead of console.info Related to #7470 (which was reverted in #7478 due to regression from immediate emission timing change). This PR includes only the stderr output change without any timing modifications. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
0979126 to
4c13de7
Compare
BenchmarksBenchmark execution time: 2026-02-12 02:11:05 Comparing candidate commit 4c13de7 in PR branch Found 0 performance improvements and 0 performance regressions! Performance is the same for 232 metrics, 28 unstable metrics. |
rochdev
left a comment
There was a problem hiding this comment.
Worth noting that his will only send to stderr by default. When a custom logger is configured, it will go to wherever that logger is configured to send its logs, but I'm assuming this is intended.
LGTM!
Changed startup logs to output to stderr (via console.warn) instead of stdout (via console.info), following Unix conventions and aligning with other Datadog language tracers. This is a minimal change that only swaps the output stream - no changes to timing or function structure. Changes: - Changed startupLog() to use warn() instead of info() for stderr output - Updated all tests to expect console.warn instead of console.info Related to #7470 (which was reverted in #7478 due to regression from immediate emission timing change). This PR includes only the stderr output change without any timing modifications. Co-authored-by: Claude Sonnet 4.5 <noreply@anthropic.com>
Changed startup logs to output to stderr (via console.warn) instead of stdout (via console.info), following Unix conventions and aligning with other Datadog language tracers. This is a minimal change that only swaps the output stream - no changes to timing or function structure. Changes: - Changed startupLog() to use warn() instead of info() for stderr output - Updated all tests to expect console.warn instead of console.info Related to #7470 (which was reverted in #7478 due to regression from immediate emission timing change). This PR includes only the stderr output change without any timing modifications. Co-authored-by: Claude Sonnet 4.5 <noreply@anthropic.com>
What does this PR do?
Changes startup logs to output to stderr (via
console.warn) instead of stdout (viaconsole.info), following Unix conventions and aligning with other Datadog language tracers.This PR addresses only the stderr output change from #7470, which was reverted in #7478 due to a regression introduced by the immediate emission timing change. This PR does NOT modify when the logs are emitted - they continue to be emitted on the first payload sent to the agent (same timing as before).
Changing the timing of logs will be done in a future PR
Motivation
Diagnostic and informational logs should be sent to stderr rather than stdout, following standard Unix conventions. This aligns with how other Datadog language tracers handle startup logs.
Additional Notes
Related PRs:
This PR includes only the safe stderr output change without the problematic timing modification.
How to test the change?
Run the startup-log tests:
All tests should pass and verify that startup logs use
console.warn(stderr) instead ofconsole.info(stdout).🤖 Generated with Claude Code