From 250664d8eb1d38e84cd995ce28992c8be5730086 Mon Sep 17 00:00:00 2001 From: mpl Date: Mon, 3 Nov 2014 22:15:02 +0100 Subject: [PATCH] camput: use Errorf to print critical errors even when non-verbose http://camlistore.org/issue/524 Change-Id: Ied24471288ea459785291281afa7316a257b6884 --- cmd/camput/camput.go | 2 +- pkg/cmdmain/cmdmain.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/cmd/camput/camput.go b/cmd/camput/camput.go index bf2482222..fd80a8c2e 100644 --- a/cmd/camput/camput.go +++ b/cmd/camput/camput.go @@ -100,7 +100,7 @@ func initUploader() { func handleResult(what string, pr *client.PutResult, err error) error { if err != nil { - log.Printf("Error putting %s: %s", what, err) + cmdmain.Errorf("Error putting %s: %s\n", what, err) cmdmain.ExitWithFailure = true return err } diff --git a/pkg/cmdmain/cmdmain.go b/pkg/cmdmain/cmdmain.go index 1e250fb47..bc1eff592 100644 --- a/pkg/cmdmain/cmdmain.go +++ b/pkg/cmdmain/cmdmain.go @@ -290,7 +290,7 @@ func Main() { if err != nil { if !ExitWithFailure { // because it was already logged if ExitWithFailure - log.Printf("Error: %v", err) + Errorf("Error: %v\n", err) } Exit(2) }