Closed peterbourgon closed 8 years ago
Is putting a logger
field into most structs, and adding an extra arg to the initialisation methods really the best way to go about this?
Most things have access to router.Ourself
, so could just use the logger in that.
Though ironically with my changes in #33 and the changes in here, I think LocalPeer isn't actually doing any logging itself anymore - it only needs a logger in order to feed it into the LocalConnection constructor.
I elected to make the minimum changes necessary. I am happy to refactor further. May I delete methods like remoteConnection.log, or is that prefix useful/necessary?
It would be easier to integrate this with other schemes if it took an interface rather than a concrete *log.Logger
.
Fixes #21