improve: suppress dotenv startup log message - #3641
Closed
droplet-rl wants to merge 1 commit into
Closed
Conversation
@risk-labs/logger pulls in dotenv@17, which since v16.6 prints an
'injected env (N) from .env // tip: ...' advert on every startup. The
logger calls dotenv.config() at import time, so the suppression must be
an env var set before any imports run; passing { quiet: true } to the
repo's own config() call would not reach it (and the repo's direct
dotenv dependency is 16.3.1, which never logs). Same pattern as
scripts/buildJussiGraph.ts (#3161).
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
droplet-rl
requested review from
bmzig,
dijanin-brat,
mrice32,
nicholaspai and
pxrl
as code owners
July 29, 2026 09:29
Contributor
Author
|
Closing in favor of the upstream fix in risk-labs/logger#31 — we control the logger, so silencing dotenv at the source covers all consumers. The relayer will pick it up via a @risk-labs/logger version bump once that's released. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
Every bot startup prints a dotenv advert:
What
Sets
DOTENV_CONFIG_QUIET=true(unless already set by the operator) as the first statement of the runtime entry point, before any imports run.Why this shape instead of
config({ quiet: true })The noisy dotenv is not the repo's own — this repo resolves
dotenv@16.3.1, which predates the log message entirely (it arrived in 16.6.0). The message comes from@risk-labs/logger, whoseTransports.tscallsdotenv.config()with its own nesteddotenv@17.4.2at import time — i.e. beforeindex.ts's ownconfig()call ever executes. So adding{ quiet: true }to the repo'sconfig()call would be a no-op on both counts.The env var is dotenv's documented suppression switch and reaches every dotenv instance in the process, including the logger's. Verified against dotenv@17.4.2: silent with
DOTENV_CONFIG_QUIET=true, noisy without.??=keeps it operator-overridable. Same pattern already used inscripts/buildJussiGraph.ts(#3161);tsconfigtargets CommonJS, so the assignment is emitted ahead of the firstrequire.No doc updates needed (no behavior/config/interface change beyond log noise).
Requested by Paul in Slack: https://risklabs.slack.com/archives/C0BHMM63D9Q/p1785316898296319
🤖 Generated with Claude Code