Skip to content

Commit

Permalink
Fix logrus package name change and missing name in NewWithAWSConfig
Browse files Browse the repository at this point in the history
- 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.
  • Loading branch information
Surendar Chandra committed Jun 8, 2017
1 parent b37c6d1 commit a3274b5
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 28 deletions.
7 changes: 4 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ logrus_firehose

```go
import (
"github.com/Sirupsen/logrus"
"github.com/sirupsen/logrus"
"github.com/beaubrewer/logrus_firehose"
)

Expand Down Expand Up @@ -62,15 +62,16 @@ logrus_firehose

```go
import (
"github.com/Sirupsen/logrus"
"github.com/sirupsen/logrus"
"github.com/beaubrewer/logrus_firehose"
)

func main() {
hook, err := logrus_firehose.New("my_stream", Config{
hook, err := logrus_firehose.New("my_stream", logrus_firehose.Config{
AccessKey: "ABC", // AWS accessKeyId
SecretKey: "XYZ", // AWS secretAccessKey
Region: "us-west-2",
Endpoint: "firehose.us-west-2.amazonaws.com",
})

// set custom fire level
Expand Down
27 changes: 10 additions & 17 deletions glide.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions glide.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package: github.com/wildworks/logrus_firehose
import:
- package: github.com/Sirupsen/logrus
version: ^0.11.4
- package: github.com/sirupsen/logrus
version: ^1.0.0
- package: github.com/aws/aws-sdk-go
version: ^1.7.3
subpackages:
Expand Down
11 changes: 6 additions & 5 deletions hook.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ import (
"encoding/json"
"fmt"

"github.com/Sirupsen/logrus"
"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/aws/session"
"github.com/aws/aws-sdk-go/service/firehose"
"github.com/sirupsen/logrus"
)

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

svc := firehose.New(sess)
return &FirehoseHook{
client: svc,
levels: defaultLevels,
ignoreFields: make(map[string]struct{}),
filters: make(map[string]func(interface{}) interface{}),
client: svc,
defaultStreamName: name,
levels: defaultLevels,
ignoreFields: make(map[string]struct{}),
filters: make(map[string]func(interface{}) interface{}),
}, nil
}

Expand Down
2 changes: 1 addition & 1 deletion hook_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"testing"
"time"

"github.com/Sirupsen/logrus"
"github.com/sirupsen/logrus"
"github.com/stretchr/testify/assert"
)

Expand Down

0 comments on commit a3274b5

Please sign in to comment.