Forráskód Böngészése

vendor: update gopkg.in/clog.v1

Unknwon 8 éve
szülő
commit
7bd6052efe

+ 1 - 1
vendor/gopkg.in/clog.v1/README.md

@@ -1,4 +1,4 @@
-# Clog [![Build Status](https://travis-ci.org/go-clog/clog.svg?branch=master)](https://travis-ci.org/go-clog/clog) [![GoDoc](https://godoc.org/gopkg.in/clog.v1?status.svg)](https://godoc.org/gopkg.in/clog.v1)
+# Clog [![Build Status](https://travis-ci.org/go-clog/clog.svg?branch=master)](https://travis-ci.org/go-clog/clog) [![GoDoc](https://godoc.org/gopkg.in/clog.v1?status.svg)](https://godoc.org/gopkg.in/clog.v1) [![Sourcegraph](https://sourcegraph.com/github.com/go-clog/clog/-/badge.svg)](https://sourcegraph.com/github.com/go-clog/clog?badge)
 
 ![](https://avatars1.githubusercontent.com/u/25576866?v=3&s=200)
 

+ 1 - 1
vendor/gopkg.in/clog.v1/clog.go

@@ -24,7 +24,7 @@ import (
 )
 
 const (
-	_VERSION = "1.0.0"
+	_VERSION = "1.0.2"
 )
 
 // Version returns current version of the package.

+ 15 - 8
vendor/gopkg.in/clog.v1/slack.go

@@ -18,24 +18,25 @@ import (
 	"bytes"
 	"errors"
 	"fmt"
+	"io/ioutil"
 	"net/http"
 )
 
 const (
 	SLACK             = "slack"
 	_SLACK_ATTACHMENT = `{
-    "attachments": [
-        {
-            "text": "%s",
-            "color": "%s",
-        }
-    ]
+	"attachments": [
+		{
+			"text": "%s",
+			"color": "%s"
+		}
+	]
 }`
 )
 
 var slackColors = []string{
 	"",        // Trace
-	"blue",    // Info
+	"#3aa3e3", // Info
 	"warning", // Warn
 	"danger",  // Error
 	"#ff0200", // Fatal
@@ -93,10 +94,16 @@ func (s *slack) ExchangeChans(errorChan chan<- error) chan *Message {
 
 func (s *slack) write(msg *Message) {
 	attachment := fmt.Sprintf(_SLACK_ATTACHMENT, msg.Body, slackColors[msg.Level])
-	if _, err := http.Post(s.url, "application/json", bytes.NewReader([]byte(attachment))); err != nil {
+	resp, err := http.Post(s.url, "application/json", bytes.NewReader([]byte(attachment)))
+	if err != nil {
 		s.errorChan <- fmt.Errorf("slack: %v", err)
 	}
+	defer resp.Body.Close()
 
+	if resp.StatusCode/100 != 2 {
+		data, _ := ioutil.ReadAll(resp.Body)
+		s.errorChan <- fmt.Errorf("slack: %s", data)
+	}
 }
 
 func (s *slack) Start() {

+ 3 - 3
vendor/vendor.json

@@ -525,10 +525,10 @@
 			"revisionTime": "2015-09-24T05:17:56Z"
 		},
 		{
-			"checksumSHA1": "Vr5TuupT09ayqksRWW8Ll1dr+yY=",
+			"checksumSHA1": "TlOZMrb/wY8vsDIGkXlmxsbDLP0=",
 			"path": "gopkg.in/clog.v1",
-			"revision": "d359c289366a4385d98d25fa59d14602148333ea",
-			"revisionTime": "2017-02-10T00:11:21Z"
+			"revision": "bf4bf4a49c663cd0963f8775a4b60d30a75098d1",
+			"revisionTime": "2017-02-17T23:04:09Z"
 		},
 		{
 			"checksumSHA1": "LIu3jihd3edOyIsJJK3V6vx2UZg=",