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

Unified Diff: client/cmd/logdog_annotee/main.go

Issue 1812403002: Annotee: Use WithError. (Closed) Base URL: https://github.com/luci/luci-go@master
Patch Set: Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: client/cmd/logdog_annotee/main.go
diff --git a/client/cmd/logdog_annotee/main.go b/client/cmd/logdog_annotee/main.go
index 7522cc46225fa5e5e7b9da83ab1cb0200919fc9c..aba5ef3fc99e311602f55569294109044406cefb 100644
--- a/client/cmd/logdog_annotee/main.go
+++ b/client/cmd/logdog_annotee/main.go
@@ -135,27 +135,21 @@ func mainImpl(args []string) int {
var err error
a.bootstrap, err = bootstrap.Get()
if err != nil {
- log.Fields{
- log.ErrorKey: err,
- }.Warningf(a, "Could not get LogDog Butler bootstrap information.")
+ log.WithError(err).Warningf(a, "Could not get LogDog Butler bootstrap information.")
}
fs := &flag.FlagSet{}
logFlags.AddFlags(fs)
a.addToFlagSet(fs)
if err := fs.Parse(args); err != nil {
- log.Fields{
- log.ErrorKey: err,
- }.Errorf(a, "Failed to parse flags.")
+ log.WithError(err).Errorf(a, "Failed to parse flags.")
return configErrorReturnCode
}
a.Context = logFlags.Set(a.Context)
client, err := a.getStreamClient()
if err != nil {
- log.Fields{
- log.ErrorKey: err,
- }.Errorf(a, "Failed to get stream client instance.")
+ log.WithError(err).Errorf(a, "Failed to get stream client instance.")
return configErrorReturnCode
}
@@ -211,9 +205,7 @@ func mainImpl(args []string) int {
e.TeeStderr = os.Stderr
}
if err := e.Run(a, args); err != nil {
- log.Fields{
- log.ErrorKey: err,
- }.Errorf(a, "Failed during execution.")
+ log.WithError(err).Errorf(a, "Failed during execution.")
return runtimeErrorReturnCode
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698