Releases: theogravity/loglayer
v4.4.0
v4.3.3
Patch Changes
-
a824b32
Thanks @theogravity! - Update README copyUpdates the README intro to sound less... odd.
v4.3.2
Patch Changes
58a9eaa
Thanks @theogravity! - Update readme intro copy
v4.3.1
Patch Changes
-
#29
0d5a9c7
Thanks @theogravity! - Fixes child logger not inheriting plugins.Before plugins, hooks were copied to the child logger, so this fix makes the behavior consistent with prior behavior.
The README for child loggers has been updated
to include that plugins are now inherited.
v4.3.0
Minor Changes
-
74756da
Thanks @theogravity! - AddonMetadataCalled()
plugin callback to hook intowithMetadata()
andmetadataOnly()
calls.See the README section on
intercept metadata calls
for usage details.
Patch Changes
- #27
a6fb176
Thanks @theogravity! - RefactorPluginManager
for performance improvements.
v4.2.1
Patch Changes
- #25
e5632c8
Thanks @theogravity! - Readme updates
v4.2.0
Minor Changes
-
#23
e6323b7
Thanks @theogravity! - Addsignale
supportSee README.md for more details.
-
#20
c3b5468
Thanks @theogravity! - Addlog4js-node
supportSee README.md for more details.
-
#22
2dfe830
Thanks @theogravity! - Addfatal
log level support- Adds the
fatal()
method inloglayer
to write to afatal
log level.- Any logging libraries that do not support
fatal
level will
be written as anerror
level instead.
- Any logging libraries that do not support
- Adds the
-
#24
f989f15
Thanks @theogravity! - Add consola support
v4.1.1
Patch Changes
- #18
14b969c
Thanks @theogravity! - Tiny perf improvements
v4.1.0
Minor Changes
-
#15
c583c94
Thanks @theogravity! - Adds an optionalid
field to plugins and the ability to manage plugins.The following methods have been added:
LogLayer#removePlugin(id: string)
LogLayer#enablePlugin(id: string)
LogLayer#disablePlugin(id: string)
v4.0.0
Major Changes
-
#13
d1a8cc2
Thanks @theogravity! - - Removes hooks and adds a plugin system where you can define multiple hooks to run instead.- Adds esm and cjs builds to the package
Breaking Changes
- The
hooks
option has been removed - The
setHooks()
method has been removed - A
plugins
option has been added - An
addPlugins()
method has been added
There will be a way to remove / disable specific plugins in a future release.
Migrating from 3.x to 4.x
Your 3.x definition may look like this:
{ hooks: { onBeforeDataOut: (data) => { // do something with data return data; }, shouldSendToLogger: () => { return true; } } }
The 4.x version of this would look like this:
{ plugins: [ { onBeforeDataOut: (data) => { // do something with data return data; }, shouldSendToLogger: () => { return true; }, }, ]; }
Type changes:
LogLayerHooksConfig
->LogLayerPlugin
HookBeforeDataOutParams
->PluginBeforeDataOutParams
HookBeforeDataOutFn
->PluginBeforeDataOutFn
HookShouldSendToLoggerParams
->PluginShouldSendToLoggerParams
HookShouldSendToLoggerFn
->PluginShouldSendToLoggerFn
Summary:
- Replace
hooks
withplugins
- For your existing hooks, move them into the
plugins
array where each entry is an object with the hook definition
See the README.md
plugin section for more details.