Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(160)

Issue 1149313002: go: Replace Logrus with go-logging. (Closed)

Created:
5 years, 7 months ago by Vadim Sh.
Modified:
5 years, 7 months ago
CC:
chromium-reviews
Base URL:
https://chromium.googlesource.com/infra/infra.git@master
Target Ref:
refs/heads/master
Project:
infra
Visibility:
Public.

Description

go: Replace Logrus with go-logging. The initial plan was to use glog. But glog turned out to be very rigid: * No way to expose command line flags via non-default flag parser. * No way to change logging level (and other configs) NOT via command line. * Non-configurable stack frame detector: all log lines are marked as produced by wrapping function, not where logger was called. (Wrapping functions are necessary to wrap glog global functions into Logger interface) -> useless. go-logging was chosen as reasonably flexible library (like Logrus), that is still pretty lightweight (no dependencies, unlike Logrus). Supports colors too! R=iannucci@chromium.org, seanmccullough@chromium.org BUG= Committed: https://chromium.googlesource.com/infra/infra/+/36d0a36b0f90ef34686f738539a2756a4b068959

Patch Set 1 #

Total comments: 3

Patch Set 2 : remove debug statements #

Total comments: 4

Patch Set 3 : get rid of IsTerminal #

Total comments: 4

Patch Set 4 : #

Patch Set 5 : #

Patch Set 6 : typo #

Unified diffs Side-by-side diffs Delta from patch set Stats (+105 lines, -131 lines) Patch
M go/Goopfile View 1 2 3 1 chunk +1 line, -2 lines 0 comments Download
M go/Goopfile.lock View 1 2 3 1 chunk +1 line, -2 lines 0 comments Download
M go/src/infra/libs/auth/auth.go View 1 2 2 chunks +0 lines, -9 lines 0 comments Download
M go/src/infra/libs/auth/auth_test.go View 1 2 3 4 chunks +6 lines, -12 lines 0 comments Download
M go/src/infra/libs/logging/appengine.go View 1 2 1 chunk +0 lines, -1 line 0 comments Download
A go/src/infra/libs/logging/go-logging.go View 1 2 3 4 5 1 chunk +33 lines, -0 lines 0 comments Download
M go/src/infra/libs/logging/logging.go View 1 2 3 2 chunks +10 lines, -22 lines 0 comments Download
D go/src/infra/libs/logging/logrus.go View 1 chunk +0 lines, -14 lines 0 comments Download
D go/src/infra/libs/logging/logrus_test.go View 1 chunk +0 lines, -14 lines 0 comments Download
M go/src/infra/monitoring/analyzer/analyzer.go View 4 chunks +4 lines, -4 lines 0 comments Download
M go/src/infra/monitoring/client/client.go View 1 chunk +2 lines, -2 lines 0 comments Download
M go/src/infra/monitoring/dispatcher/dispatcher.go View 4 chunks +10 lines, -6 lines 0 comments Download
M go/src/infra/monitoring/messages/alerts.go View 1 chunk +2 lines, -2 lines 0 comments Download
M go/src/infra/tools/cipd/apps/cipd/main.go View 1 2 3 20 chunks +36 lines, -41 lines 0 comments Download

Messages

Total messages: 12 (2 generated)
Vadim Sh.
https://codereview.chromium.org/1149313002/diff/1/go/Goopfile File go/Goopfile (right): https://codereview.chromium.org/1149313002/diff/1/go/Goopfile#newcode24 go/Goopfile:24: github.com/op/go-logging #b45e089a5a94cc79c8e78fc03cd83d04b5d8410f will setup mirror now
5 years, 7 months ago (2015-05-21 23:15:16 UTC) #1
iannucci
lgtm https://codereview.chromium.org/1149313002/diff/2/go/Goopfile File go/Goopfile (right): https://codereview.chromium.org/1149313002/diff/2/go/Goopfile#newcode24 go/Goopfile:24: github.com/op/go-logging #b45e089a5a94cc79c8e78fc03cd83d04b5d8410f sort? https://codereview.chromium.org/1149313002/diff/2/go/src/infra/libs/logging/go-logging.go File go/src/infra/libs/logging/go-logging.go (right): https://codereview.chromium.org/1149313002/diff/2/go/src/infra/libs/logging/go-logging.go#newcode35 ...
5 years, 7 months ago (2015-05-21 23:19:23 UTC) #2
Vadim Sh.
also removed IsTerminal, ptal https://codereview.chromium.org/1149313002/diff/2/go/Goopfile File go/Goopfile (right): https://codereview.chromium.org/1149313002/diff/2/go/Goopfile#newcode24 go/Goopfile:24: github.com/op/go-logging #b45e089a5a94cc79c8e78fc03cd83d04b5d8410f On 2015/05/21 23:19:23, ...
5 years, 7 months ago (2015-05-21 23:24:50 UTC) #3
iannucci
lgtm though I'm wondering if 2 was due to reportError? https://codereview.chromium.org/1149313002/diff/1/go/src/infra/tools/cipd/apps/cipd/main.go File go/src/infra/tools/cipd/apps/cipd/main.go (right): https://codereview.chromium.org/1149313002/diff/1/go/src/infra/tools/cipd/apps/cipd/main.go#newcode39 ...
5 years, 7 months ago (2015-05-21 23:30:42 UTC) #4
seanmccullough
lgtm Not a huge fan of Warningf instead of Warnf but that's fine. https://codereview.chromium.org/1149313002/diff/30001/go/src/infra/libs/logging/go-logging.go File ...
5 years, 7 months ago (2015-05-21 23:49:14 UTC) #5
Vadim Sh.
ExtraCalldepth = 2 was due to additional layer of wrapping in functions like: func Infof(...) ...
5 years, 7 months ago (2015-05-21 23:49:26 UTC) #6
iannucci
lgtm. copyright update seems like a good nit :)
5 years, 7 months ago (2015-05-21 23:51:43 UTC) #7
Vadim Sh.
https://codereview.chromium.org/1149313002/diff/30001/go/src/infra/libs/logging/go-logging.go File go/src/infra/libs/logging/go-logging.go (right): https://codereview.chromium.org/1149313002/diff/30001/go/src/infra/libs/logging/go-logging.go#newcode1 go/src/infra/libs/logging/go-logging.go:1: // Copyright 2014 The Chromium Authors. All rights reserved. ...
5 years, 7 months ago (2015-05-21 23:53:32 UTC) #8
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1149313002/90001
5 years, 7 months ago (2015-05-21 23:55:36 UTC) #11
commit-bot: I haz the power
5 years, 7 months ago (2015-05-22 00:01:18 UTC) #12
Message was sent while issue was closed.
Committed patchset #6 (id:90001) as
https://chromium.googlesource.com/infra/infra/+/36d0a36b0f90ef34686f738539a27...

Powered by Google App Engine
This is Rietveld 408576698