- 5bf006d: Create a child method to allow for creating new loggers with existing options
- 166b58b: Remove an extraneous log statement
- e940f93: The
@ogma/styler
instance is now exposed at the.style
property of ogma
- 5113fa3: Create a new
mixin
option for open telemetry and dynamic metadata support
- 6cd729d: Allow for the value of a masked property to be null or undefined
- 3044ab1: Set a default file descriptor for sonic-boom. This is helpful in environments like vitest
- 5ee0fed: Make it so that the "each" option does not end up double printing the arrays of objects passed to the logger
- 5ee0fed: Fix an issue with sonic-boom not printing all the logs in a worker thread
- 44e293a: Properly ignore the hostname, pid, and application in json logsm if the option is set to not usethem
- 743cf48: Removed the index type from the ogma options to allow for better intellisense
- e67b383: Make sonic-boom work inside worker threads
- 15b6f6f: Allow the log level to be changed during runtime
-
fa89834: Major performance boosts
-
Stringified objects with
Symbol
s now have the Symbol output asSymbol: description
instead ofSymbol(description)
-
BigInt
s are now handled in the stringification -
no longer 0 non-
@ogma/
deps -
time is now output in milliseconds since epoch in JSON format
-
JSON logs keep the
.message
property even in the case of logging objects -
default stream in Node environments now uses
sonic-boom
instead ofprocess.stdout
-
Unification of how objects get stringified to make all non-standard properties act the same.
-
speed. Using
toISOString()
is a bit slow. Fast enough for the string format but wanted to speed up JSON just a tiny bit more, plus it's supposed to be machine readable more than anything -
By keeping the
.message
property, even in the case of objects we're able to eliminate an if check and keep the speeds up on the JSON logging. Also, gives a defined proeprty that the user defined message will always be at
Mostly, everything should be handled under the hood, it's more of just new deps and format changes to be aware of.
-
- Updated dependencies [be1367c]
- @ogma/[email protected]
- 1c2854e: Fixed issues 1634 - Verbose logging bad printing
- dd5215e: Security updates of dependencies. Should be nothing major here.
- Updated dependencies [dd5215e]
- @ogma/[email protected]
- @ogma/[email protected]
- 8370e11: Allow for
each
to be set at a global level when initializing an Ogma instance
-
33c279b: Fix dependencies for better install experience
@ogma/common
and@ogma/styler
were set as peerDependencies instead of dependencies meaning package managers wouldn't install them by default. They are now properly set as dependencies@ogma/logger
was set as a peerDependency instead of a dependency. Now has been set to a dependency.
-
2e65080: Update {each: true } to separate via space, not newline
- 2f5ccce: Allow for printing of each array value
- d2cbc49: added ability to modify logger message (remove pid, application, hostname)
-
33061ad: Adds the ability to mask values of an object while logging based on an initial array config
A
masks
property can now be passed to theOgma
constructor. This property is an array, and will be checked against the keys of an object that Ogma is logging. If the key matches a value in the array, Ogma will replace the value with a string of asterisks (*
) matching the length of the original string.e.g.
ogma.log({ password: '12345' })
will log the object
{ password: '*****' }
- 90d2d53: add 'levelKey' option
- 85fd2f4: Ogma no longer assigns `getColorDepth` if
options.stream
isprocess.stdout
-
8bea02f: Release of
@ogma/common
and@ogma/styler
. Upgrade@ogma/nestjs-module
to be 100% compatible with Nest's logger@ogma/logger
now depends on@ogma/common
and@ogma/styler
for types and string styling, instead of managing it on its own@ogma/nestjs-module
now acceptstrace
as the second parameter toerror
instead ofcontext
.meta
can still be passed as a second parameter too or it can be a third parameter.@ogma/logger
now sets anool
property when logging in JSON mode to accommodate when using a custom log map@ogma/logger
no longer needs thestream
property to have ahasColor
function@ogma/cli
now reads from theool
property insteadlevel
to allow writing back to Ogma's standard format
@ogma/logger
now correctly logs Error objects the same wayprocess.stdout
does instead of logging{}
@ogma/logger
can accept alevelMap
property for custom level mapping@ogma/logger
'sstream
option can now have agetColorDepth
property method, but it is not necessary
I wanted to be able to have full control over string styles and this gave me a great chance to learn about SGRs and how they work. Along with that, this gave me the perfect opportunity to make some changes to the logger to be more compliant with Nest's logger and have better compatibility with it.
I tried to make this is painless as possible in terms of breaking changes. For the most part, you should just be able to upgrade with no problems. If you have a stream with
hasColor
you will need to remove that method. You may want to add in thegetColorDepth
method, but can also just useFORCE_COLOR
if necessary.
- Updated dependencies [8bea02f]
- @ogma/[email protected]
- @ogma/[email protected]
-
bbf66f6: Major release of @ogma
The
ogma
command has been moved from@ogma/logger
to@ogma/cli
. There are no other breaking changes. This change was made to keep the package size as small as possible and to keep the code clean and maintainable.
All notable changes to this project will be documented in this file. See Conventional Commits for commit guidelines.
0.4.2 (2020-10-26)
- OFF means no logs (bde8068)
- logger: move log level to earlier in the log (da00caa)
0.4.0 (2020-10-25)
- all: log methods now take an object as the second parameter instead of having 3 extra optional parameters
0.3.1 (2020-09-12)
- logger: logger will not print function names when objects have funcs (c496d16)
0.3.0 (2020-09-05)
- all: add request id generation and log (00fd8c7)
0.2.2 (2020-08-10)
- logger: logs Symbol(name) instead of Symbol to be more clear (137db86)
0.2.1 (2020-07-25)
- logger: adds hostname to the log output (a1f2b8d)
0.2.0 (2020-07-20)
- logger: adds hostname to the log output (a1f2b8d)
0.1.1 (2020-07-18)
- gql: updates gql types to work with apollo > 2.11 (a097842)
0.1.0 (2020-04-20)
- module: let base module work for http express (1bb52a7)
- logger: gets the pid at logger creation instead of at log time (d8913d0)