Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update dependencies #18

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 13 additions & 9 deletions cmd/kafka-hook/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ package main

import (
"fmt"
"io/ioutil"
"io"
"os"

"github.com/Shopify/sarama"
"github.com/IBM/sarama"
"github.com/mailgun/logrus-hooks/common"
"github.com/mailgun/logrus-hooks/kafkahook"
"github.com/sirupsen/logrus"
Expand All @@ -20,7 +20,8 @@ func checkErr(msg string, err error) {
}

func main() {
desc := args.Dedent(`CLI for kafkahook
desc := args.Dedent(
`CLI for kafkahook

Examples:
export KAFKAHOOK_ENDPOINTS=kafka1:9092,kafka2:9092
Expand All @@ -32,7 +33,8 @@ func main() {
$ kafka-hook "This is a message line" -o "http.request=http://foo/bar" -o "foo=bar"

Send custom JSON to kafkahook
$ echo -e '{"custom":"json"}' | kafkahook -v`)
$ echo -e '{"custom":"json"}' | kafkahook -v`,
)

parser := args.NewParser(args.EnvPrefix("KAFKAHOOK_"), args.Desc(desc, args.IsFormated))
parser.AddOption("--verbose").Alias("-v").IsTrue().Help("be verbose")
Expand All @@ -47,10 +49,12 @@ func main() {
// Parser and set global options
opts := parser.ParseSimple(nil)

hook, err := kafkahook.New(kafkahook.Config{
Endpoints: opts.StringSlice("endpoints"),
Topic: opts.String("topic"),
})
hook, err := kafkahook.New(
kafkahook.Config{
Endpoints: opts.StringSlice("endpoints"),
Topic: opts.String("topic"),
},
)
checkErr("KafkaHook Error", err)

if opts.Bool("verbose") {
Expand All @@ -71,7 +75,7 @@ func main() {
}
}

logrus.SetOutput(ioutil.Discard)
logrus.SetOutput(io.Discard)
logrus.AddHook(hook)

if opts.IsSet("other") {
Expand Down
10 changes: 6 additions & 4 deletions cmd/udplog/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package main

import (
"fmt"
"io/ioutil"
"io"
"os"
"strconv"
"strings"
Expand All @@ -21,7 +21,8 @@ func checkErr(msg string, err error) {
}

func main() {
desc := args.Dedent(`CLI for udplog
desc := args.Dedent(
`CLI for udplog

Examples:
export UDPLOG_ADDRESS=localhost:55647
Expand All @@ -33,7 +34,8 @@ func main() {
$ udplog "This is a message line" -o "http.request=http://foo/bar" -o "foo=bar"

Send custom JSON to udplog
$ echo -e '{"custom":"json"}' | udplog -v`)
$ echo -e '{"custom":"json"}' | udplog -v`,
)

parser := args.NewParser(args.EnvPrefix("UDPLOG_"), args.Desc(desc, args.IsFormated))
parser.AddOption("--verbose").Alias("-v").IsTrue().Help("be verbose")
Expand Down Expand Up @@ -76,7 +78,7 @@ func main() {
}
}

logrus.SetOutput(ioutil.Discard)
logrus.SetOutput(io.Discard)
logrus.AddHook(hook)

if opts.IsSet("other") {
Expand Down
58 changes: 42 additions & 16 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,22 +1,48 @@
module github.com/mailgun/logrus-hooks

go 1.12
go 1.22

require (
github.com/Shopify/sarama v1.23.1
github.com/fatih/structs v1.1.0 // indirect
github.com/go-ini/ini v1.46.0 // indirect
github.com/mailgun/holster/v3 v3.3.2
github.com/mailru/easyjson v0.0.0-20190626092158-b2ccc519800e
github.com/onsi/ginkgo v1.9.0 // indirect
github.com/onsi/gomega v1.6.0 // indirect
github.com/pkg/errors v0.8.1
github.com/sirupsen/logrus v1.4.2
github.com/smartystreets/goconvey v0.0.0-20190731233626-505e41936337 // indirect
github.com/spf13/cast v1.3.0 // indirect
github.com/stretchr/testify v1.4.0
github.com/IBM/sarama v1.43.0
github.com/mailgun/holster/v3 v3.16.2
github.com/mailru/easyjson v0.7.7
github.com/pkg/errors v0.9.1
github.com/sirupsen/logrus v1.9.3
github.com/stretchr/testify v1.9.0
github.com/thrawn01/args v0.3.0
gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127
gopkg.in/ini.v1 v1.46.0 // indirect
gopkg.in/jcmturner/goidentity.v3 v3.0.0 // indirect
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c
)

require (
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/eapache/go-resiliency v1.6.0 // indirect
github.com/eapache/go-xerial-snappy v0.0.0-20230731223053-c322873962e3 // indirect
github.com/eapache/queue v1.1.0 // indirect
github.com/fatih/structs v1.1.0 // indirect
github.com/fsnotify/fsnotify v1.7.0 // indirect
github.com/go-ini/ini v1.67.0 // indirect
github.com/golang/snappy v0.0.4 // indirect
github.com/hashicorp/errwrap v1.1.0 // indirect
github.com/hashicorp/go-multierror v1.1.1 // indirect
github.com/hashicorp/go-uuid v1.0.3 // indirect
github.com/jcmturner/aescts/v2 v2.0.0 // indirect
github.com/jcmturner/dnsutils/v2 v2.0.0 // indirect
github.com/jcmturner/gofork v1.7.6 // indirect
github.com/jcmturner/gokrb5/v8 v8.4.4 // indirect
github.com/jcmturner/rpc/v2 v2.0.3 // indirect
github.com/josharian/intern v1.0.0 // indirect
github.com/klauspost/compress v1.17.7 // indirect
github.com/kr/pretty v0.3.1 // indirect
github.com/kr/text v0.2.0 // indirect
github.com/onsi/ginkgo v1.16.5 // indirect
github.com/onsi/gomega v1.31.1 // indirect
github.com/pierrec/lz4/v4 v4.1.21 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 // indirect
github.com/rogpeppe/go-internal v1.12.0 // indirect
github.com/spf13/cast v1.6.0 // indirect
golang.org/x/crypto v0.20.0 // indirect
golang.org/x/net v0.21.0 // indirect
golang.org/x/sys v0.17.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
)
Loading