ilp-protocol-stream icon indicating copy to clipboard operation
ilp-protocol-stream copied to clipboard

Don't serialize JSON for logging unless debug is on

Open sharafian opened this issue 7 years ago • 1 comments

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.

sharafian avatar Nov 15 '18 23:11 sharafian

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.

sentientwaffle avatar Nov 16 '18 15:11 sentientwaffle