You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
feat(config): warn on unknown log levels and accept upper-case LOGIXIA_LEVEL #29
resolveInitialLevel (src/core/logitron-logger.ts line 131) takes process.env.LOGIXIA_LEVEL or levelOptions.level as-is. The numeric lookup in _buildPerfCaches (around line 336) then does this._levelValues.get(effectiveLevel) ?? 2. So:
LOGIXIA_LEVEL=DEBUG (upper case) silently becomes info, because the level map keys are lower case
a typo like levelOptions: { level: 'warning' } silently becomes info
setLevel('nope') (line 510) keeps the old threshold but stores 'nope', so getLevel() returns a level that isn't in effect
What to do
Normalise the resolved level to lower case in resolveInitialLevel and in setLevel
When the level isn't in _levelValues (built-ins plus custom levels), call internalWarn once per logger with the bad value and the list of valid levels, then fall back to info as today
In setLevel, refuse unknown levels: warn and keep the current level, so getLevel() stays truthful
Tests in src/core/__tests__/level-validation.test.ts:
LOGIXIA_LEVEL=DEBUG enables debug
unknown level warns once and logs at info
a custom level such as kafka is accepted
setLevel('nope') warns and getLevel() is unchanged
Acceptance criteria
npx jest src/core/__tests__/level-validation.test.ts passes, and the full npx jest still passes
npm run typecheck && npm run lint pass
Hints
internalWarn is in src/utils/internal-log.ts. Tests can silence or capture it, see src/utils/__tests__/internal-log.test.ts.
src/core/__tests__/custom-levels.test.ts shows how custom levels are configured.
I completed the fix for this issue in PR #51, which has now been merged.
The changes include log-level validation, normalization, and regression tests.
I didn't post an initial claim before starting the work, so I'm documenting the completed contribution here for transparency. Thank you for reviewing and merging the fix!
Activity
github-actions commentedon Oct 24, 2026
🎉 This issue has been resolved in version 1.12.6.
Install it:
npm install logixia@1.12.6Disha-k-gowda commentedon Oct 24, 2026
I completed the fix for this issue in PR #51, which has now been merged.
The changes include log-level validation, normalization, and regression tests.
I didn't post an initial claim before starting the work, so I'm documenting the completed contribution here for transparency. Thank you for reviewing and merging the fix!