loglayer
Changelog
5.5.1
Patch Changes
#140
d708ff7
Thanks @theogravity! - FixmetadataOnly
typescript def. The second parameter should always be optional.Updated dependencies [
d708ff7
]:- @loglayer/shared@1.2.1
- @loglayer/plugin@1.2.2
- @loglayer/transport@1.2.4
5.5.0
Minor Changes
- #138
54b8223
Thanks @theogravity! - Add withFreshTransports method tologlayer
Patch Changes
- Updated dependencies [
54b8223
]:- @loglayer/shared@1.2.0
- @loglayer/transport@1.2.3
- @loglayer/plugin@1.2.1
5.4.1
Patch Changes
- #135
b23976d
Thanks @theogravity! - Updates the main example code on the README.md file.
5.4.0
Minor Changes
- #129
d8054c8
Thanks @theogravity! - LogLayer now passes theloglayer
instance as the last parameter to all plugin callbacks
Patch Changes
- Updated dependencies [
d8054c8
]:- @loglayer/plugin@1.2.0
- @loglayer/shared@1.1.0
- @loglayer/transport@1.2.2
5.3.0
Minor Changes
#127
bf2022b
Thanks @theogravity! - Add new options to theConsoleTransport
:messageField
: Allows you to specify the field in the log message object where the message should be stored. This is useful when you want to log structured data and need to specify the field name for the message.level
: Sets the minimum log level to process. Messages with a lower priority level will be ignored.
5.2.0
Minor Changes
- #122
e944b8d
Thanks @theogravity! - Performance improvements around using multiple transports
5.1.4
Patch Changes
#112
561a1a6
Thanks @theogravity! - Update changelog doc formatting, add links to documentation siteUpdated dependencies [
561a1a6
]:- @loglayer/transport@1.2.1
- @loglayer/plugin@1.1.1
- @loglayer/shared@1.0.5
Changelogs for other core libraries:
5.1.3
Patch Changes
- #110
13154ed
Thanks @theogravity! - -loglayer
: Fix an issue where if you use a plugin that creates metadata, and no metadata was present prior, it does not save@loglayer/transport-opentelemetry
: Add a note about the difference between the plugin and the transport
5.1.2
Patch Changes
- Updated dependencies [
f3b89d3
]:- @loglayer/transport@1.2.0
5.1.1
Patch Changes
- Updated dependencies [
06c8c20
]:- @loglayer/transport@1.1.5
5.1.0
Minor Changes
- #97
c38d650
Thanks @theogravity! - Add plugin lifecycle methodonContextCalled
to interceptwithContext
calls
Patch Changes
- Updated dependencies [
c38d650
]:- @loglayer/plugin@1.1.0
5.0.12
Patch Changes
- Updated dependencies [
d01dcb9
]:- @loglayer/transport@1.1.4
5.0.11
Patch Changes
- #79
f88d492
Thanks @theogravity! - - Fixes an issue where a transport will still be called even if the enabled flag for it is false- Adds the
enabled?
flag to theLogLayerTransport
interface in@loglayer/transport
- Updates
@loglayer/transport-datadog
to not initialize the client lib if the transport is disabled
- Adds the
5.0.10
Patch Changes
- #74
d92fce0
Thanks @theogravity! - Add an optionappendObjectData
inConsoleTransport
to allow for the object data to be at the end of the log entry instead of the beginning.
5.0.9
Patch Changes
- #67
174f545
Thanks @theogravity! - Add exports from @loglayer/plugin
5.0.8
Patch Changes
- Updated dependencies [
cef5ab1
]:- @loglayer/shared@1.0.4
- @loglayer/plugin@1.0.4
- @loglayer/transport@1.1.3
5.0.7
Patch Changes
- Updated dependencies [
4a25d33
]:- @loglayer/transport@1.1.2
5.0.6
Patch Changes
476702c
Thanks @theogravity! - Update about copy
5.0.5
Patch Changes
- Updated dependencies [
372a062
]:- @loglayer/transport@1.1.1
5.0.4
Patch Changes
- Updated dependencies [
8aeeeb4
]:- @loglayer/transport@1.1.0
5.0.3
Patch Changes
43ffd72
Thanks @theogravity! - docs: fix up documentationUpdated dependencies [
43ffd72
]:- @loglayer/transport@1.0.3
- @loglayer/plugin@1.0.3
- @loglayer/shared@1.0.3
5.0.2
Patch Changes
- Updated dependencies [
c136c0f
]:- @loglayer/plugin@1.0.2
- @loglayer/shared@1.0.2
- @loglayer/transport@1.0.2
5.0.1
Patch Changes
87394f9
Thanks @theogravity! - AddtransportId
parameter to pluginshouldSendToLogger
callUpdated dependencies [
87394f9
,da9bc6f
]:- @loglayer/plugin@1.0.1
- @loglayer/transport@1.0.1
- @loglayer/shared@1.0.1
5.0.0
Major Changes
New documentation site is available at loglayer.dev.
Migration from 4.x to 5.x is available at here.
- Introduced new transport system
- Replaced direct logger instance and type configuration with transport-specific packages
- Added new transport classes for each supported logger type
- See Transport documentation for details
- Configuration changes
- Moved error configuration options to root level (
errorSerializer
,errorFieldName
,copyMsgOnOnlyError
) - Moved context and metadata field names to root level (
contextFieldName
,metadataFieldName
) - Added new
errorFieldInMetadata
option to control error object placement
- Moved error configuration options to root level (
- Removed support for Node.js 14 and 16
- Updated minimum Node.js version requirement to Node.js 18
- Updated all dependencies to their latest major versions
- Improved TypeScript type definitions and stricter type checking
- Removed deprecated APIs and legacy compatibility code
4.8.0
Minor Changes
7033d6e
Thanks @theogravity! - Add support for @datadog/browser-logs
4.7.0
Minor Changes
14f4ce1
Thanks @theogravity! - Change messages property of ShouldSendToLoggerParams and PluginBeforeMessageOutParams toany
fromMessageDataType
. This allows for more flexibility in the messages property of these params since external libraries may feed in different types of data.
4.6.1
Patch Changes
09991a3
Thanks @theogravity! - Update docs
4.6.0
Minor Changes
- #40
25212bd
Thanks @theogravity! - AddonBeforeMessageOut
callback to plugins
4.5.0
Minor Changes
- #38
afdfbdd
Thanks @theogravity! - - AddwithError
/withMetadata
/enableLogging
/disableLogging
toILogBuilder
.ILogBuilder
now has<ErrorType = ErrorDataType>
.
4.4.1
Patch Changes
- #36
40bb3b5
Thanks @theogravity! - Add enable/disableLogger to ILogLayer
4.4.0
Minor Changes
#33
1d67e1f
Thanks @theogravity! - Fix ILogLayer return typesILogLayer#withPrefix()
andILogLayer#withChild()
were of the incorrect return type.Changed to
ILogLayer<ExternalLogger, ErrorType>
.
4.3.3
Patch Changes
a824b32
Thanks @theogravity! - Update README copyUpdates the README intro to sound less... odd.
4.3.2
Patch Changes
58a9eaa
Thanks @theogravity! - Update readme intro copy
4.3.1
Patch Changes
#29
0d5a9c7
Thanks @theogravity! - Fixes child transport not inheriting plugins.Before plugins, hooks were copied to the child transport, 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.
4.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.
4.2.1
Patch Changes
- #25
e5632c8
Thanks @theogravity! - Readme updates
4.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
4.1.1
Patch Changes
- #18
14b969c
Thanks @theogravity! - Tiny perf improvements
4.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)
4.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:
typescript{ hooks: { onBeforeDataOut: ({ data }) => { // do something with data return data; }, shouldSendToLogger: () => { return true; } } }
The 4.x version of this would look like this:
typescript{ 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
README.md
for more details.
3.1.0
- Added new configuration option
muteContext
andmuteMetadata
to disable context and metadata logging. - Added the following methods:
LogLayer#muteContext()
LogLayer#unmuteContext()
LogLayer#muteMetadata()
LogLayer#unmuteMetadata()
See readme for usage details.
Internal: Switch from eslint
to biomejs.dev
for linting.
3.0.1
- Created a separate Typescript type for the
onBeforeDataOut
hook parameter,OnBeforeDataOutParams
.
3.0.0
Breaking change
- The hook
onBeforeDataOut
signature has changed- from:
onBeforeDataOut(data)
- to:
onBeforeDataOut({ data, logLevel })
- from:
2.0.3
Contributor: Theo Gravity
- Adds
electron-log
support.
2.0.2 - Mon Mar 20 2023 16:46:04
Contributor: Theo Gravity
- Exports the
HookShouldSendToLoggerParams
type and sets a default value for theData
generic.
2.0.1 - Mon Mar 20 2023 13:19:47
Contributor: Theo Gravity
- Fixed issue where
shouldSendToLogger
may not send logs out becausemessages
may have been manipulated.messages
is now a copy of the original.
2.0.0 - Mon Mar 20 2023 12:25:30
Contributor: Theo Gravity
Breaking change
The shouldSendToLogger
hook parameter is now an object, and adds in logLevel
as a property.
See README.md
for updated usage details.
1.6.0 - Wed Mar 15 2023 13:25:45
Contributor: Theo Gravity
- Add
shouldSendToLogger
hook (#11)
This hook allows you to conditionally send a log entry or not to the transport.
1.5.0 - Wed Mar 01 2023 13:11:13
Contributor: Theo Gravity
- Added log message prefixing
- Can be set via
prefix
config option, orLogLayer#withPrefix()
. See README.md for usage info.
- Can be set via
- Fix issue where
LogLayer#child()
was setting empty context data when context has not been set at all
1.4.2 - Wed Nov 02 2022 05:23:14
Contributor: Theo Gravity
- Fix issue where
LogLayer#child()
was not creating a shallow copy of context (#10)
The documentation says the context should be shallow copied, but it wasn't. Now it is.
1.4.1 - Wed Nov 02 2022 05:06:51
Contributor: Theo Gravity
- Add support for creating child loggers (#9)
This adds a new method called LogLayer#child()
that will create a new LogLayer instance with the original configuration and context data copied over.
1.3.4 - Mon Aug 22 2022 20:18:36
Contributor: Theo Gravity
- Add consoleDebug option (#7)
1.3.3 - Wed Aug 10 2022 04:17:36
Contributor: Theo Gravity
- Add config option and methods to disable / enable logging (#6)
This adds an optional config option called enabled
, when set to false
, will stop log output.
Corresponding methods enableLogging()
and disableLogging()
have also been added.
1.3.2 - Wed Aug 10 2022 02:24:37
Contributor: Theo Gravity
- Add
setHooks()
method (#5)
Adds a new method on LogLayer
called setHooks()
that allows hooks to be set or updated after creation of the LogLayer
.
Useful as an alternative to using configuration on init to set a hook
1.3.1 - Wed Aug 10 2022 02:01:35
Contributor: Theo Gravity
- Add hooks feature, add onBeforeDataOut hook (#4)
This adds the ability to register hooks with LogLayer
. The first available hook, onBeforeDataOut()
, allows manipulation of the data object before it is sent to the logging library.
See the README.md
hooks section for more details.
1.2.1 - Tue Aug 09 2022 01:50:05
Contributor: Theo Gravity
- Fix issue where data is lost if fieldName for context and metadata is the same (#3)
If you configure the context and metadata fieldName to have the same name, only the metadata is captured, while the context is lost.
The data is now merged into the shared field.
1.1.1 - Mon Jun 13 2022 22:14:21
Contributor: Theo Gravity
- Add getContext() (#2)
Adds a new method to the transport, getContext()
, which returns the current context.
1.0.2 - Mon Nov 29 2021 04:16:06
Contributor: Theo Gravity
- Update README.md
1.0.1 - Mon Nov 29 2021 03:48:11
Contributor: Theo Gravity
Make withContext() chainable (#1)
withContext()
is now chainable. Most will want to call it right after creating a newLogLayer
instead of having a separate line for it.