ilp-protocol-stream
ilp-protocol-stream copied to clipboard
Don't serialize JSON for logging unless debug is on
All the debug statements in the stream library use string interpolation with backticks. This means that the objects are serialized for logging before they're passed to debug, and may not be printed if debug is turned off. We should make sure that these unnecessary string operations don't happen unless debug is actually enabled.
I think ilp-logger supports formatting e.g. %o. Using that would prevent JSON.stringifys when logging is disabled, as well as extra string interpolation.