logoalt Hacker News

I couldn't find a logging library that worked for my library, so I made one

9 pointsby todsacerdotiyesterday at 3:46 PM6 commentsview on HN

Comments

malfistyesterday at 11:41 PM

Almost every logger in java operates this way. You set your library logging to debug and the end user and configure if they want debug logs from your library or not. They can even set context variables.

cowlbyyesterday at 11:49 PM

This feels a bit like a pub/sub pattern; I wonder what it would look like with a full pub/sub implementation.

reactordevtoday at 12:11 AM

At least you learned something

seniorsassycattoday at 1:28 AM

I really want something like this to be built into the language or runtime, I don't want to juggle configuration for 4 different libraries. Log4j and tracing seem to be well established without being built in, but it feels too late for js.

I'm curious if this is enough https://nodejs.org/api/diagnostics_channel.html

I don't like the js hotel libraries, their docs feel deliberately obtuse

bgoosmanyesterday at 11:44 PM

Wasn't OpenTelemetry invented for this purpose?

drdectoday at 12:43 AM

Did you consider log4js?