Skip to content

Releases: losandes/polyn-logger

fix: adds missing ArrayWriter properties

02 Mar 17:04
947f650
Compare
Choose a tag to compare

The ArrayWriter typedef was missing the history and maxSize properties, which are useful in tests

feat: adds es module support

24 Feb 05:35
ba643e6
Compare
Choose a tag to compare

What's Changed

Full Changelog: 0.5.3...0.6.0


breaking: removes support for Logger

A couple years ago, I moved on from using the orignal design of this libaray to inheriting from EventEmitter to follow a standard convention. This release is a breaking change that removes the legacy code, so only the LogEmitter will be supported moving forward.

fix: updates typedefs

The index.d.ts file was missing the listen function for ILogWriter and the LogEmitter class typedef wasn't carrying through the EventEmitter properties for some reason. This updates those typedefs and also adds new TypeScript tests to validate the changes.

fix: fixes an error where os is undefined

08 Feb 17:05
eb5307e
Compare
Choose a tag to compare

LogMetaFactory had a check for os being undefined but it throws in the
browser. This qualifies the check by addressing it on the dependencies
object.

chore: updates dependencies

01 Apr 21:11
df4c7b7
Compare
Choose a tag to compare

Updates dependencies to:

  • @polyn/blueprint 2.6.0
  • @polyn/immutable 1.0.11
  • @polyn/async-events 3.0.1

fix: Circumvents EventEmitter throw behavior

26 May 14:13
Compare
Choose a tag to compare

NodeJS' events has special behaviors with the 'error' event:

If an EventEmitter does not have at least one listener registered
for the 'error' event, and an 'error' event is emitted, the error is
thrown, a stack trace is printed, and the Node.js process exits.

This doesn't make sense for a log emitter that supports wildcards, or
patterns. This fix adds a noop listener to error to each emitter that is
created to circumvent the error throwing behavior.

feat: adds squash writer and event listeners

21 May 15:37
c0d2adf
Compare
Choose a tag to compare
  • Adds SquashWriter for flattening logs
  • Adds listen to all writers, to make them compatible with the
    LogEmitter

feat: adds try-with-metrics

20 May 16:40
107c611
Compare
Choose a tag to compare

We often need to track the performance (latency) of I/O bound
features (i.e. HTTP requests, database requests, API response
times), as well as compute bound features (i.e. algorithms).
Knowing the number of times a feature is used (counts), as well
as the volume it receives (gauges) can help us understand which
features are most important to our users, or if a feature is
actively being used, right now.

This adds tryWithMetrics to the LogEmitter, to simplify gathering
these kinds of metrics, so all you need to do is supply the writer to
get these metrics into your tracking system.

feat: adds new LogEmitter

19 May 22:17
Compare
Choose a tag to compare

Adds new LogEmitter for simpler logging:

const { LogEmitter, writers, formatters } = require('@polyn/logger')
const log = new LogEmitter()
const logWriter = new writers.DevConsoleWriter({
  formatter: new formatters.BlockFormatter()
})
const writeLog = async (meta, ...args) =>
  logWriter.write(args && args.length === 1 ? args[0] : args, meta)

// subscribe to multiple categories
;['trace', 'debug', 'info', 'warn', 'error', 'fatal'].forEach(
  (category) => log.on(category, writeLog)
)

log.emit('app_startup', 'info', { hello: 'world' })

Updates @polyn/async-events

14 Feb 15:26
Compare
Choose a tag to compare

Updates to use the latest version of @polyn/async-events

chore: removes unnecessary files

14 Dec 17:54
Compare
Choose a tag to compare

I noticed I was publishing things like screenshots. This release is after an npmignore was added to prune the package to what is necessary to install and use it.