Skip to content

bring log ux closer to dotenvx's#1003

Merged
motdotla merged 3 commits intomasterfrom
log-ux
Apr 1, 2026
Merged

bring log ux closer to dotenvx's#1003
motdotla merged 3 commits intomasterfrom
log-ux

Conversation

@motdotla
Copy link
Copy Markdown
Owner

@motdotla motdotla commented Apr 1, 2026

No description provided.

@charliecreates charliecreates bot requested a review from CharlieHelps April 1, 2026 19:33
@codecov
Copy link
Copy Markdown

codecov bot commented Apr 1, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (a31c698) to head (c1f682a).
⚠️ Report is 13 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff            @@
##            master     #1003   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files            3         3           
  Lines          476       471    -5     
=========================================
- Hits           476       471    -5     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link
Copy Markdown

@charliecreates charliecreates bot left a comment

Choose a reason for hiding this comment

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

The new logging format is a UX change that may reduce compatibility with existing log parsers/greps by removing stable [WARN]/[DEBUG] tokens and introducing Unicode glyphs. The missing .env.vault warning now risks printing null/undefined for the path, which is a user-facing regression.

Additional notes (2)
  • Readability | lib/main.js:335-341
    In this branch vaultPath is falsy, so the warning now renders ... at null/undefined (depending on what _vaultPath() returns). That’s a user-facing regression and makes the message less actionable than before.

  • Readability | lib/main.js:288-292
    These debug messages concatenate the path and error message without a delimiter; in practice this can read ambiguously (especially with paths containing spaces).

Summary of changes

Summary

  • Updated log output formatting to match dotenvx-style UX:
    • _warn() now prints ⚠ ${message} · dotenv@${version}.
    • _debug() now prints ┆ ${message} · dotenv@${version}.
    • _log() now prints ◇ ${message} · dotenv@${version}.
  • Normalized several log messages to lowercase (e.g., loading env…, failed to load…, encoding message).
  • Simplified the missing-vault warning text when DOTENV_KEY is set but no .env.vault is found.

Comment on lines 130 to 140
function _warn (message) {
console.error(`[dotenv@${version}][WARN] ${message}`)
console.error(`⚠ ${message} · dotenv@${version}`)
}

function _debug (message) {
console.log(`[dotenv@${version}][DEBUG] ${message}`)
console.log(`┆ ${message} · dotenv@${version}`)
}

function _log (message) {
console.log(`[dotenv@${version}] ${message}`)
console.log(`◇ ${message} · dotenv@${version}`)
}
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

The new log format uses Unicode glyphs (, , ) and removes the explicit [WARN]/[DEBUG] tokens. That can break downstream tooling that greps for the previous stable prefixes (or for WARN/DEBUG), and Unicode output is still a real-world compatibility issue in some CI/log pipelines and Windows terminals.

Suggestion

Consider preserving a machine-parsable severity token (and/or providing an opt-in/opt-out) while keeping the new UX. For example:

function _warn (message) {
  console.error(`⚠ [WARN] ${message} · dotenv@${version}`)
}
function _debug (message) {
  console.log(`┆ [DEBUG] ${message} · dotenv@${version}`)
}
function _log (message) {
  console.log(`◇ ${message} · dotenv@${version}`)
}

Alternatively, gate the glyphs behind an env var like DOTENV_LOG_FORMAT=pretty|classic and default to classic in non-TTY contexts.

Reply with "@CharlieHelps yes please" if you'd like me to add a commit with this suggestion.

@charliecreates charliecreates bot removed the request for review from CharlieHelps April 1, 2026 19:35
@motdotla motdotla merged commit d179cd9 into master Apr 1, 2026
7 checks passed
@motdotla motdotla deleted the log-ux branch April 1, 2026 19:52
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.

1 participant