2.0.0
This release is a major release.
The following changes were implemented in c35d1dc:
Logger.log
no longer defaults to useLogger.info
, it now requires a level parameter before any data. To preserve previous behavior, useLogger.log("INFO", ...)
- Changed the entire
LoggerLevel
system.- Registering new levels with the
addLoggerLevel
function is now possible. - In the places where logger levels were used, you now use their identifiers as a string (
LoggerLevel.WARN
->"WARN"
)
- Registering new levels with the
- Changed behavior of the default logger options.
- Removed
LoggerOptions.identifierPredicate
,LoggerOptions.identifier
no longer accepts a symbol. LoggerOptions.streams
is no longer required to be defined.LoggerOutput
renamed toLoggerStream
LoggerStream.level
now accepts a string, number, or function
Once everything is resolved to a function, it's called everytime something is logged to determine if the level is high enough to be logged.- A string is resolved to:
(importance) => importance >= LoggerLevel[level].importance
- A number is resolved to:
(importance) => importance >= level
- A function is used as-is.
- A string is resolved to:
LoggerStream.intercept
has been split intointerceptData
andinterceptMessage
LoggerStream.filter
has been removed, you can replace its functionality withLoggerStream.interceptMessage
LoggerStream.prefix
now only takes in alevel
argument.