←back to thread

28 points todsacerdoti | 2 comments | | HN request time: 0.419s | source
Show context
malfist ◴[] No.46250419[source]
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.
replies(1): >>46255117 #
1. throwaway150 ◴[] No.46255117[source]
Python too. Honestly, any mature logger should allow embedding logs in library code that can be turned on or off by the end user. This was a solved problem 20 years ago. I honestly don't see what's so novel about this today. Or is this speaking to the sorry state of software engineering that plagues the JavaScript world?
replies(1): >>46306620 #
2. danudey ◴[] No.46306620[source]
Rust also.

Similar to this: OpenTelemetry has a golang library that allows you to instrument your library so that you can send traces, logs, etc. to an OTEL endpoint, but that instrumentation doesn't actually do anything unless the developer of the actual application uses a separate golang library to actually trigger, collect, and transmit those traces. Otherwise it's basically a no-op.