Skip to content

Commit

Permalink
instantiate logrus logger from gokit
Browse files Browse the repository at this point in the history
Signed-off-by: replay <[email protected]>
  • Loading branch information
replay committed Jan 28, 2021
1 parent d59975d commit 7e508e1
Show file tree
Hide file tree
Showing 968 changed files with 278,468 additions and 2 deletions.
6 changes: 4 additions & 2 deletions exporter.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,15 @@ import (
"golang.org/x/sys/windows/svc"

"github.com/StackExchange/wmi"
gokitLogrus "github.com/go-kit/kit/log/logrus"
"github.com/prometheus-community/windows_exporter/collector"
"github.com/prometheus-community/windows_exporter/config"
"github.com/prometheus/client_golang/prometheus"
"github.com/prometheus/client_golang/prometheus/promhttp"
"github.com/prometheus/common/log"
"github.com/prometheus/common/version"
"github.com/prometheus/exporter-toolkit/https"
"github.com/sirupsen/logrus"
"gopkg.in/alecthomas/kingpin.v2"
)

Expand Down Expand Up @@ -404,8 +406,8 @@ func main() {
go func() {
log.Infoln("Starting server on", *listenAddress)
server := &http.Server{Addr: *listenAddress}
if err := https.Listen(server, *httpsConfig, logger); err != nil {
log.Fatalf("cannot start windows_exporter: %s", err)
if err := https.Listen(server, *httpsConfig, gokitLogrus.NewLogrusLogger(log.Base().(logrus.FieldLogger))); err != nil {
log.Fatalf("cannot start windows_exporter: %s", err)
}
}()

Expand Down
2 changes: 2 additions & 0 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,15 @@ require (
github.com/Microsoft/hcsshim v0.8.6
github.com/StackExchange/wmi v0.0.0-20180725035823-b12b22c5341f
github.com/dimchansky/utfbom v1.1.0
github.com/go-kit/kit v0.10.0
github.com/go-ole/go-ole v1.2.1 // indirect
github.com/google/go-cmp v0.5.1 // indirect
github.com/leoluk/perflib_exporter v0.1.0
github.com/prometheus/client_golang v1.8.0
github.com/prometheus/client_model v0.2.0
github.com/prometheus/common v0.15.0
github.com/prometheus/exporter-toolkit v0.4.0
github.com/sirupsen/logrus v1.6.0
golang.org/x/sys v0.0.0-20201015000850-e3ed0017c211
golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 // indirect
gopkg.in/alecthomas/kingpin.v2 v2.2.6
Expand Down
1 change: 1 addition & 0 deletions vendor/github.com/Microsoft/go-winio/.gitignore

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

22 changes: 22 additions & 0 deletions vendor/github.com/Microsoft/go-winio/LICENSE

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

22 changes: 22 additions & 0 deletions vendor/github.com/Microsoft/go-winio/README.md

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

280 changes: 280 additions & 0 deletions vendor/github.com/Microsoft/go-winio/backup.go

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

Loading

0 comments on commit 7e508e1

Please sign in to comment.