Closed samherrmann closed 2 years ago
If this pull request is accepted, maybe a change to the LogMessages
function should be considered so that logging all messages no longer requires a custom logger to be set (single responsibility)?
From:
func LogMessages(logger Logger) ConnOpt
To:
func LogMessages() ConnOpt
https://github.com/sourcegraph/jsonrpc2/blob/v0.1.0/conn_opt.go#L32
This would be a breaking change however.
Before this commit, a custom logger could be set with the LogMessages function. However, by using LogMessages not only is a custom logger set but also all received and sent messages are logged. Use cases exist where a custom logger is desired to log errors but not all messages.