Browse Source

vendor: update gopkg.in/clog.v1

pull/4150/head
Unknwon 8 years ago
parent
commit
7bd6052efe
No known key found for this signature in database
GPG Key ID: 25B575AE3213B2B3
  1. 2
      vendor/gopkg.in/clog.v1/README.md
  2. 2
      vendor/gopkg.in/clog.v1/clog.go
  3. 23
      vendor/gopkg.in/clog.v1/slack.go
  4. 6
      vendor/vendor.json

2
vendor/gopkg.in/clog.v1/README.md generated vendored

@ -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)

2
vendor/gopkg.in/clog.v1/clog.go generated vendored

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

23
vendor/gopkg.in/clog.v1/slack.go generated vendored

@ -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() {

6
vendor/vendor.json vendored

@ -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=",

Loading…
Cancel
Save