Skip to content

Commit a3274b5

Browse files
author
Surendar Chandra
committed
Fix logrus package name change and missing name in NewWithAWSConfig
- logrus changed its name from upper case to lower case - fix it. sirupsen/logrus#553 - NewWithAWSConfig was not passing on the name parameter. - Minor fix in readme to use the Config value.
1 parent b37c6d1 commit a3274b5

File tree

5 files changed

+23
-28
lines changed

5 files changed

+23
-28
lines changed

README.md

+4-3
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ logrus_firehose
1010

1111
```go
1212
import (
13-
"github.com/Sirupsen/logrus"
13+
"github.com/sirupsen/logrus"
1414
"github.com/beaubrewer/logrus_firehose"
1515
)
1616

@@ -62,15 +62,16 @@ logrus_firehose
6262

6363
```go
6464
import (
65-
"github.com/Sirupsen/logrus"
65+
"github.com/sirupsen/logrus"
6666
"github.com/beaubrewer/logrus_firehose"
6767
)
6868

6969
func main() {
70-
hook, err := logrus_firehose.New("my_stream", Config{
70+
hook, err := logrus_firehose.New("my_stream", logrus_firehose.Config{
7171
AccessKey: "ABC", // AWS accessKeyId
7272
SecretKey: "XYZ", // AWS secretAccessKey
7373
Region: "us-west-2",
74+
Endpoint: "firehose.us-west-2.amazonaws.com",
7475
})
7576

7677
// set custom fire level

glide.lock

+10-17
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

glide.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
package: github.com/wildworks/logrus_firehose
22
import:
3-
- package: github.com/Sirupsen/logrus
4-
version: ^0.11.4
3+
- package: github.com/sirupsen/logrus
4+
version: ^1.0.0
55
- package: github.com/aws/aws-sdk-go
66
version: ^1.7.3
77
subpackages:

hook.go

+6-5
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@ import (
44
"encoding/json"
55
"fmt"
66

7-
"github.com/Sirupsen/logrus"
87
"github.com/aws/aws-sdk-go/aws"
98
"github.com/aws/aws-sdk-go/aws/session"
109
"github.com/aws/aws-sdk-go/service/firehose"
10+
"github.com/sirupsen/logrus"
1111
)
1212

1313
var defaultLevels = []logrus.Level{
@@ -59,10 +59,11 @@ func NewWithAWSConfig(name string, conf *aws.Config) (*FirehoseHook, error) {
5959

6060
svc := firehose.New(sess)
6161
return &FirehoseHook{
62-
client: svc,
63-
levels: defaultLevels,
64-
ignoreFields: make(map[string]struct{}),
65-
filters: make(map[string]func(interface{}) interface{}),
62+
client: svc,
63+
defaultStreamName: name,
64+
levels: defaultLevels,
65+
ignoreFields: make(map[string]struct{}),
66+
filters: make(map[string]func(interface{}) interface{}),
6667
}, nil
6768
}
6869

hook_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import (
66
"testing"
77
"time"
88

9-
"github.com/Sirupsen/logrus"
9+
"github.com/sirupsen/logrus"
1010
"github.com/stretchr/testify/assert"
1111
)
1212

0 commit comments

Comments
 (0)