From 96ef5295091f40a882a94b2243e2b140a98f5c1a Mon Sep 17 00:00:00 2001 From: Dustin Sallings Date: Thu, 26 Dec 2013 01:27:56 -0800 Subject: [PATCH] remote: fix crash due to nil logger MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This happened in a well-timed HTTP failure: runtime.panic(0x674580, 0x10e67b9) /Users/dustin/prog/eprojects/go/src/pkg/runtime/panic.c:266 +0xb6 log.(*Logger).Output(0x0, 0x2, 0xc2104e4870, 0x83, 0x0, ...) /Users/dustin/prog/eprojects/go/src/pkg/log/log.go:134 +0x46b log.(*Logger).Print(0x0, 0x13b29b8, 0x1, 0x1) /Users/dustin/prog/eprojects/go/src/pkg/log/log.go:165 +0x66 camlistore.org/pkg/client.funcĀ·011(0x7da390, 0x13, 0xc21075d400, 0x1, 0x1, ...) $GOPATH/src/camlistore.org/pkg/client/upload.go:363 +0x133 camlistore.org/pkg/client.(*Client).Upload(0xc21014ec00, 0xc2109fa7b0, 0x0, 0x0, 0x0) Change-Id: I9859bc8f03ef0dd9c9b89b7e22815c5ee5b7fd87 --- pkg/blobserver/remote/remote.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pkg/blobserver/remote/remote.go b/pkg/blobserver/remote/remote.go index 89cef5b9b..7210cd618 100644 --- a/pkg/blobserver/remote/remote.go +++ b/pkg/blobserver/remote/remote.go @@ -34,6 +34,8 @@ package remote import ( "io" + "log" + "os" "camlistore.org/pkg/blob" "camlistore.org/pkg/blobserver" @@ -68,6 +70,7 @@ func newFromConfig(_ blobserver.Loader, config jsonconfig.Obj) (storage blobserv if err != nil { return nil, err } + client.SetLogger(log.New(os.Stderr, "remote", log.LstdFlags)) sto := &remoteStorage{ client: client, }