Fixes #215. It’s rather naive, but demonstrates a fix for the problem.
Logging every send/receive/request/response is very expensive for structs due to the way they’re stringified by capnproto.
Introduce the concept of verbose logging, and expose it to clients by adding a new constructor for EventLoop which accepts LogOptions.
For backwards compatibility, the existing constructor is unchanged. Additionally for back compat, a new callback function is added rather than adding a parameter to the existing one.
The usage is somewhat awkward due to the fact that the data should only be stringified if verbose logging has been requested. This could be less awkward by changing the logger to take a callback which is only called if verbosity is enabled instead, that way the slow serialization only happens in that case. Additionally, a more complete solution would introduce actual log levels rather than a binary option
But those suggestions would be rather invasive and presumably out of scope for simply fixing the linked issue.