nng icon indicating copy to clipboard operation
nng copied to clipboard

feature request: logging

Open questor opened this issue 6 years ago • 2 comments

currently logging is not possible inside the library. for most functions this is not important, but sometimes it's helpful to see if for example packets are dropped or some other debugging stuff.

best solution would be to have a handler the user can register which gets called to (asyncronously!) send it to some external logger.

questor avatar Jun 14 '18 13:06 questor

Sorry to do this... and I know what a mess logging is right now, but addressing this holistically is something that is going to need to wait until the next release. I don't want to hold 1.3 for it.

gdamore avatar Feb 26 '20 05:02 gdamore

The main uses for logging (need) is for debugging TLS and HTTP problems. TLS in particular is rather pernicious to debug, and we can't really provide sufficient information back to the caller as an error number.

HTTP logging is more likely to be needed when serving up data generally.

I'm not a fan of logging for the rest of the library, and mostly I feel that logging is the wrong answer -- a better answer is to provide meaningful content (errors) in line, so you don't need the log. HTTP servers and TLS being the one thing where it brings value. (HTTP clients should probably not bother with logging btw.)

gdamore avatar Jan 04 '21 00:01 gdamore

Years later, I'm working on this now. Stay tuned.

gdamore avatar Apr 13 '24 21:04 gdamore