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.
tslog
comes with some default log levels forinfo
/warn
/etc.The problem is that if you're using tslog with custom log severities, things like
log.info
may stop working and outputs nothing. See for example below where I have a custom severity that setsINFO=9
To solve this problem, I have to build a mapping from my custom severity levels to the
tslog
severities so that my code can look likeHowever, to create the
mapSeverity
function, it would be nice to haveDefaultLogLevels
exposed as an enum from this libraryShould this PR be merged
Adding an
enum
does increase the library size by a few lines of code. If every byte matters, you could argue this isn't worth it for a feature not everybody needs.I think just the existence of this PR that explains the issue and shows the code may be enough to unblock people who can copy-paste this enum into their own code (and can link to this PR if they want share context on where the enum came from and why it's needed)