fix: harden log level handling and stabilize test suite for v1.2.2 #66

Merged
mburchard merged 9 commits from bughunt into main 2026-02-26 11:29:03 +00:00
Owner

Summary

This PR consolidates bug fixes, test hardening, and documentation updates for the 1.2.2 patch release.

Changes

  • normalize LogLevel handling across logger and appender entry points
  • prevent lazy payload runtime errors by wrapping evaluated function payloads as single elements
  • warn on invalid LogLevel values instead of silently accepting them
  • replace fragile file-size assertions with semantic content assertions in tests
  • replace timeout-based synchronization with robust async waiting in tests
  • relax brittle error object assertions to message-based matching
  • deduplicate repeated SQLite log entry assertions via shared test helper
  • document lazy evaluation behavior in the README
  • clean up wording/punctuation in stack-trace related comments and specs
  • update dependencies and bump package version to 1.2.2

Why

  • improves runtime safety for logging behavior
  • reduces flaky and brittle tests
  • clarifies library behavior in docs
  • keeps the patch release focused on stability and quality

Test plan

  • pnpm lint passes
  • pnpm typecheck passes
  • 261 tests passed
  • 100% line/branch coverage
  • pnpm build succeeds
## Summary This PR consolidates bug fixes, test hardening, and documentation updates for the 1.2.2 patch release. ## Changes - normalize `LogLevel` handling across logger and appender entry points - prevent lazy payload runtime errors by wrapping evaluated function payloads as single elements - warn on invalid `LogLevel` values instead of silently accepting them - replace fragile file-size assertions with semantic content assertions in tests - replace timeout-based synchronization with robust async waiting in tests - relax brittle error object assertions to message-based matching - deduplicate repeated SQLite log entry assertions via shared test helper - document lazy evaluation behavior in the README - clean up wording/punctuation in stack-trace related comments and specs - update dependencies and bump package version to `1.2.2` ## Why - improves runtime safety for logging behavior - reduces flaky and brittle tests - clarifies library behavior in docs - keeps the patch release focused on stability and quality ## Test plan - [x] `pnpm lint` passes - [x] `pnpm typecheck` passes - [x] 261 tests passed - [x] 100% line/branch coverage - [x] `pnpm build` succeeds
- AbstractBaseAppender.level: convert from public property to
  getter/setter that normalises via toLogLevel()
- Logger constructor and level getter fallback: normalise consistently
- Logger.logEvent(): normalise level before writing to ILogEvent
- AbstractBaseAppender.handle(): extract willHandle() guard into
  template method, subclasses implement doHandle() instead
- Remove redundant toLogLevel() calls in shouldLog() and
  configureLogging() where values are already numeric
- Update all test assertions to use toLogLevel('...') for readability
- Remove redundant noinspection comments and normalize test comments in specs
- Introduce expectLogEntry helper in SQLiteAppender.spec.ts for repeated log entry checks
- Keep SqlDialectInspection suppression at file level for IntelliJ SQL parsing in tests
chore: update dependencies and bump version to 1.2.2
All checks were successful
Run Tests / test (pull_request) Successful in 1m9s
Run Tests / test (push) Successful in 1m10s
Publish Package to npmjs / build (release) Successful in 55s
74c0c2a486
mburchard deleted branch bughunt 2026-02-26 11:29:03 +00:00
Sign in to join this conversation.
No description provided.