Releases: SwanX1/logerian
3.1.0
3.0.0
2.1.1
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.
1.2.3
1.2.2
1.2.1
1.2.0
This is a non-breaking release.
UPDATE: Please use release 1.2.1 instead of this one.
The following features were implemented:
- 21daaac: Added intercept predicate to LoggerOutput
The following minor changes were implemented:
- e01145d: Updated dependencies, bumped version number
- d784f75: this in predicates is now the logger instance
- 54ef3e3: any[] replaced with unknown[]
Various CI/CD changes were implemented too that don't affect the library.
1.1.1
This release tweaks some minor things:
remoteOutput
method- Default logger level is now DEBUG
- Duplicate streams are now filtered
Most notably, the release features (almost) proper documentation via JSDocs and the README.
1.1.0
This release adds logger hierarchy, which means loggers can log to other loggers now.
Child loggers will prepend their identifier prefix (if set in the logger options) to the data meaning you can now have multiple loggers for each module of your project without worrying about setting a hard-coded prefix in their messages each time.
This release also updates some development dependencies and has improved GitHub actions workflows.