New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

stop using glog #189

Closed
miekg opened this Issue Mar 9, 2018 · 1 comment

Comments

Projects
None yet
2 participants
@miekg
Copy link
Collaborator

miekg commented Mar 9, 2018

Is this a bug report or a feature request?:

feature request

What happened:

metallb should probably stop using glog (unless it must, because being in google github org?). glog is a badly designed go package and we should stop it spreading even further.

See this bug report: coredns/coredns#1597 and a hilarious twitter thread

TL;DR: anything else is probably better suited.

@danderson

This comment has been minimized.

Copy link
Member

danderson commented Mar 11, 2018

LGTM, I have no special attachment to glog, I just used it because it's familiar from work.

Reference to a good structured logging library: https://godoc.org/github.com/go-kit/kit/log

danderson added a commit to danderson/metallb that referenced this issue Apr 14, 2018

Hide glog's flags from the commandline. google#189
We are fortunate, in that we only register flags in main.go, so we can
just overwrite the base commandline flag set with a new one, which
effectively hides all flags that weren't defined in main(). Just before
doing that, we set --logtostderr=true for glog, so that it doesn't try
to do file I/O other than writing to os.Stderr.

This is step one of trying to remove glog from MetalLB.

danderson added a commit that referenced this issue Apr 14, 2018

Hide glog's flags from the commandline. #189
We are fortunate, in that we only register flags in main.go, so we can
just overwrite the base commandline flag set with a new one, which
effectively hides all flags that weren't defined in main(). Just before
doing that, we set --logtostderr=true for glog, so that it doesn't try
to do file I/O other than writing to os.Stderr.

This is step one of trying to remove glog from MetalLB.

@danderson danderson self-assigned this Apr 14, 2018

@danderson danderson added this to the v0.6.0 milestone Apr 14, 2018

danderson added a commit to danderson/metallb that referenced this issue Apr 15, 2018

Create internal/logging to set up structured logging and redirect glog.
google#189

This change doesn't start to use structured logging yet, strictly speaking.
It just intercepts all glog messages, parses them back out into structured
pieces, and then logs that as logfmt-formatted entries.

danderson added a commit that referenced this issue Apr 15, 2018

Create internal/logging to set up structured logging and redirect glog.
#189

This change doesn't start to use structured logging yet, strictly speaking.
It just intercepts all glog messages, parses them back out into structured
pieces, and then logs that as logfmt-formatted entries.

danderson added a commit to danderson/metallb that referenced this issue Apr 15, 2018

danderson added a commit to danderson/metallb that referenced this issue Apr 15, 2018

danderson added a commit to danderson/metallb that referenced this issue Apr 15, 2018

Stop using glog in the main binaries. google#189
There's still the internal libraries that need plumbing.

danderson added a commit to danderson/metallb that referenced this issue Apr 15, 2018

danderson added a commit to danderson/metallb that referenced this issue Apr 15, 2018

danderson added a commit to danderson/metallb that referenced this issue Apr 15, 2018

Switch to JSON-formatted logging. google#189
Not sure I like the JSON format yet, but let's give it a test drive.

danderson added a commit to danderson/metallb that referenced this issue Apr 15, 2018

danderson added a commit that referenced this issue Apr 15, 2018

Stop using glog in the main binaries. #189
There's still the internal libraries that need plumbing.

danderson added a commit that referenced this issue Apr 15, 2018

Switch to JSON-formatted logging. #189
Not sure I like the JSON format yet, but let's give it a test drive.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment