about summary refs log tree commit diff
path: root/tools/nixery/server/config/config.go
diff options
context:
space:
mode:
authorVincent Ambo <tazjin@google.com>2019-10-06T13·48+0100
committerVincent Ambo <github@tazj.in>2019-10-06T22·05+0100
commitd7ffbbdea47738acac24593f7e4448dd9c1df8ff (patch)
treef01fe2b9b0e491d6dbae84152a950df1414812d7 /tools/nixery/server/config/config.go
parentc1020754a2a2a4058fd70d4b0a8276ccadd9545f (diff)
refactor(server): Use logrus convenience functions for logs
Makes use of the `.WithError` and `.WithField` convenience functions
in logrus to simplify log statement construction.

This has the added benefit of making it easier to correctly log
errors.
Diffstat (limited to 'tools/nixery/server/config/config.go')
-rw-r--r--tools/nixery/server/config/config.go9
1 files changed, 2 insertions, 7 deletions
diff --git a/tools/nixery/server/config/config.go b/tools/nixery/server/config/config.go
index 9447975aa9a2..fe05734ee6ac 100644
--- a/tools/nixery/server/config/config.go
+++ b/tools/nixery/server/config/config.go
@@ -36,16 +36,11 @@ func signingOptsFromEnv() *storage.SignedURLOptions {
 		return nil
 	}
 
-	log.WithFields(log.Fields{
-		"account": id,
-	}).Info("GCS URL signing enabled")
+	log.WithField("account", id).Info("GCS URL signing enabled")
 
 	k, err := ioutil.ReadFile(path)
 	if err != nil {
-		log.WithFields(log.Fields{
-			"file":  path,
-			"error": err,
-		}).Fatal("failed to read GCS signing key")
+		log.WithError(err).WithField("file", path).Fatal("failed to read GCS signing key")
 	}
 
 	return &storage.SignedURLOptions{