Skip to content

2.0.0

Compare
Choose a tag to compare
@github-actions github-actions released this 30 Nov 19:42
· 5 commits to main since this release
2.0.0
c35d1dc

This release is a major release.
The following changes were implemented in c35d1dc:

  • Logger.log no longer defaults to use Logger.info, it now requires a level parameter before any data. To preserve previous behavior, use Logger.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")
  • 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 to LoggerStream
  • 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.
  • LoggerStream.intercept has been split into interceptData and interceptMessage
  • LoggerStream.filter has been removed, you can replace its functionality with LoggerStream.interceptMessage
  • LoggerStream.prefix now only takes in a level argument.