Skip to content
This repository has been archived by the owner on May 5, 2022. It is now read-only.

Don't serialize JSON for logging unless debug is on #94

Open
sharafian opened this issue Nov 15, 2018 · 1 comment
Open

Don't serialize JSON for logging unless debug is on #94

sharafian opened this issue Nov 15, 2018 · 1 comment

Comments

@sharafian
Copy link

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.

@sentientwaffle
Copy link
Contributor

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.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants