forked from samuel/go-zookeeper
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
WithLogger connOption and Conn.logInfo bool (samuel#170)
* add WithLogger connOption This allows setting the logger as the connection is created, rather than racing to call SetLogger while the connection's goroutine might already be logging a successful (or failed) connection. In addition using WithLogger works around the data race between SetLogger and the connection's goroutine. The data race is NOT fixed by this commit. AFAICS doing so is a nontrivial. Every access to conn.logger would need to be atomic. * add Conn.logInfo bool controling informational messages By default it is enabled for backwards compatability, but by setting logInfo=false you can have silence on stderr when no errors are in fact occurring. This is desireable for commandline tools, where the convention I prefer is that silence indicates success.
- Loading branch information
Showing
1 changed file
with
34 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters