weaveworks / mesh

A tool for building distributed applications.
Apache License 2.0
889 stars 107 forks source link

Remove all global log invocations #31

Closed peterbourgon closed 8 years ago

peterbourgon commented 8 years ago

Fixes #21

rade commented 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.

peterbourgon commented 8 years ago

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?

rade commented 8 years ago

33 gets rid of remoteConnection.log.

bboreham commented 8 years ago

It would be easier to integrate this with other schemes if it took an interface rather than a concrete *log.Logger.

peterbourgon commented 8 years ago

Agreed. https://github.com/weaveworks/mesh/issues/37