Feature request: Narrow LogLevel type to not allow arbitrary strings #1309
Labels
completed
This item is complete and has been merged/shipped
feature-request
This item refers to a feature request for an existing or new utility
logger
This item relates to the Logger Utility
Use case
Raising this ticket after the discussion in #1198.
Currently the
LogLevel
type allows for any string to be used, but at runtime it validates the value and if it doesn't match one of the valid log levels (as perisValidLogLevel()
) it silently ignores the log level passed in and uses the default.This has two problems:
Regarding 1. above, the following typo currently compiles. It would be better for the typo to be detected at compile time:
Solution/User Experience
Narrow the
LogLevel
type definition, removing the| string
part.Alternative solutions
No response
Acknowledgment
The text was updated successfully, but these errors were encountered: