fix(type): replace hardcoded log method with generic ones from Logger.levels - #2636
Open
Rignchen wants to merge 4 commits into
Open
fix(type): replace hardcoded log method with generic ones from Logger.levels#2636Rignchen wants to merge 4 commits into
Rignchen wants to merge 4 commits into
Conversation
Rignchen
force-pushed
the
bugfix/typescript-log-methods
branch
3 times, most recently
from
July 23, 2026 22:13
82da695 to
5d6b1a3
Compare
….levels Replace the hardcoded LeveledLogMethod properties on Logger (error, warn, help, data, info, debug, prompt, http, verbose, input, silly, emerg, alert, crit, warning, notice) with a mapped type derived from the keys of the logger's levels object, mirroring what lib/winston/create-logger.js already does at runtime through (Object.keys(opts.levels).forEach(...)).
Rignchen
marked this pull request as draft
July 23, 2026 22:31
Author
|
I'm separating what Claude did and what I did in different commits for more clarity (I'm not bringing the massive comments of nothing he added back though) |
Rignchen
force-pushed
the
bugfix/typescript-log-methods
branch
from
July 23, 2026 22:36
5d6b1a3 to
b4fae54
Compare
Rignchen
marked this pull request as ready for review
July 23, 2026 22:37
Rignchen
force-pushed
the
bugfix/typescript-log-methods
branch
2 times, most recently
from
July 25, 2026 23:56
b7b5deb to
a37b955
Compare
Rignchen
force-pushed
the
bugfix/typescript-log-methods
branch
from
July 26, 2026 00:33
a37b955 to
5f65b06
Compare
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.
Replace the hardcoded LeveledLogMethod properties on Logger (
error,warn,help,data,info,debug,prompt,http,verbose,input,silly,emerg,alert,crit,warning,notice) with a mapped type derived from the keys of the logger's levels object, mirroring whatlib/winston/create-logger.jsalready does at runtime through(Object.keys(opts.levels).forEach(...))I normally don't use AI, but since this wasn't hard, just time consuming I did ask claude AI, to make it, then just reviewed and corrected what it did, if you want me to I can re-do it by hand (it would most likely have some differences as claude said to have seen things in the documentation that I didn't see)