Skip to content

docs: clarify align behavior and demonstrate padded simple output - #368

Open
a5768549 wants to merge 1 commit into
winstonjs:masterfrom
a5768549:fix/align-simple-composition
Open

a5768549 wants to merge 1 commit into
winstonjs:masterfrom
a5768549:fix/align-simple-composition

Conversation

@a5768549

Copy link
Copy Markdown

Related to #58.

align() prepends a tab to the message; it does not pad the level. With simple(), different level lengths can reach different tab stops. This documents that limitation and adds an executable padLevels() + simple() example using the existing API. The explanation covers custom levels, the raw LEVEL symbol, finalizer ordering, fixed-width prefixes and the limitation of string-length padding for Unicode terminal cells.

Runtime behavior is unchanged. This does not claim to fix the output of align() + simple() or resolve every alignment layout. Nine characterization/composition tests cover the documented behavior and recipe, including metadata and colorized output. Custom color registrations are restored after each test.

Validation at head 3319427:

  • Windows / Node 24.19.0: npm test (including lint/build), 178 passing; TypeScript check passed. The actual README snippet was executed.
  • Linux / Node 22, 24 and 26: npm test, 178 passing on each, versus 169 on the unchanged baseline. Test-name inventories contain all baseline cases plus the nine additions. TypeScript checks passed.
  • The combine/colorize files also pass in both orders, 30 tests per order. Existing lint warnings are unchanged (16, zero errors).

Fork validation: https://github.com/a5768549/logform/actions/runs/40403945764

AI assistance: Hermes Agent prepared the documentation and tests and ran the validation; an independent agent review found a test-state leak, which was corrected and rechecked. No separate human review or maintainer approval is claimed.

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