From c5a545540d8d950d48cb894866f93a7e8c68694b Mon Sep 17 00:00:00 2001 From: Calle Pettersson Date: Sat, 30 Jan 2021 11:16:53 +0100 Subject: [PATCH] Take over prometheus/common/log into local log package Signed-off-by: Calle Pettersson --- collector/ad.go | 2 +- collector/collector.go | 2 +- collector/container.go | 2 +- collector/cs.go | 2 +- collector/dfsr.go | 2 +- collector/dns.go | 2 +- collector/exchange.go | 2 +- collector/fsrmquota.go | 2 +- collector/hyperv.go | 2 +- collector/iis.go | 2 +- collector/logical_disk.go | 2 +- collector/logon.go | 2 +- collector/memory.go | 2 +- collector/msmq.go | 2 +- collector/mssql.go | 2 +- collector/net.go | 2 +- collector/netframework_clrexceptions.go | 2 +- collector/netframework_clrinterop.go | 2 +- collector/netframework_clrjit.go | 2 +- collector/netframework_clrloading.go | 2 +- collector/netframework_clrlocksandthreads.go | 2 +- collector/netframework_clrmemory.go | 2 +- collector/netframework_clrremoting.go | 2 +- collector/netframework_clrsecurity.go | 2 +- collector/os.go | 2 +- collector/perflib.go | 2 +- collector/process.go | 2 +- collector/remote_fx.go | 2 +- collector/service.go | 2 +- collector/smtp.go | 2 +- collector/system.go | 2 +- collector/tcp.go | 2 +- collector/terminal_services.go | 2 +- collector/textfile.go | 2 +- collector/thermalzone.go | 2 +- collector/time.go | 2 +- collector/vmware.go | 2 +- collector/wmi.go | 2 +- config/config.go | 2 +- exporter.go | 2 +- go.mod | 1 + 41 files changed, 41 insertions(+), 40 deletions(-) diff --git a/collector/ad.go b/collector/ad.go index 6a01944d..6511a582 100644 --- a/collector/ad.go +++ b/collector/ad.go @@ -6,8 +6,8 @@ import ( "errors" "github.com/StackExchange/wmi" + "github.com/prometheus-community/windows_exporter/log" "github.com/prometheus/client_golang/prometheus" - "github.com/prometheus/common/log" ) func init() { diff --git a/collector/collector.go b/collector/collector.go index f7973ed3..25e43d47 100644 --- a/collector/collector.go +++ b/collector/collector.go @@ -7,8 +7,8 @@ import ( "strings" "github.com/leoluk/perflib_exporter/perflib" + "github.com/prometheus-community/windows_exporter/log" "github.com/prometheus/client_golang/prometheus" - "github.com/prometheus/common/log" "golang.org/x/sys/windows/registry" ) diff --git a/collector/container.go b/collector/container.go index 8d2ef192..ed9bdc2f 100644 --- a/collector/container.go +++ b/collector/container.go @@ -4,8 +4,8 @@ package collector import ( "github.com/Microsoft/hcsshim" + "github.com/prometheus-community/windows_exporter/log" "github.com/prometheus/client_golang/prometheus" - "github.com/prometheus/common/log" ) func init() { diff --git a/collector/cs.go b/collector/cs.go index f545b701..1978855c 100644 --- a/collector/cs.go +++ b/collector/cs.go @@ -6,8 +6,8 @@ import ( "errors" "github.com/StackExchange/wmi" + "github.com/prometheus-community/windows_exporter/log" "github.com/prometheus/client_golang/prometheus" - "github.com/prometheus/common/log" ) func init() { diff --git a/collector/dfsr.go b/collector/dfsr.go index 2573ca94..da71d9d1 100644 --- a/collector/dfsr.go +++ b/collector/dfsr.go @@ -3,8 +3,8 @@ package collector import ( + "github.com/prometheus-community/windows_exporter/log" "github.com/prometheus/client_golang/prometheus" - "github.com/prometheus/common/log" "gopkg.in/alecthomas/kingpin.v2" ) diff --git a/collector/dns.go b/collector/dns.go index d9ec9d91..c350488a 100644 --- a/collector/dns.go +++ b/collector/dns.go @@ -6,8 +6,8 @@ import ( "errors" "github.com/StackExchange/wmi" + "github.com/prometheus-community/windows_exporter/log" "github.com/prometheus/client_golang/prometheus" - "github.com/prometheus/common/log" ) func init() { diff --git a/collector/exchange.go b/collector/exchange.go index 0a51d050..b478cdcb 100644 --- a/collector/exchange.go +++ b/collector/exchange.go @@ -7,8 +7,8 @@ import ( "os" "strings" + "github.com/prometheus-community/windows_exporter/log" "github.com/prometheus/client_golang/prometheus" - "github.com/prometheus/common/log" "gopkg.in/alecthomas/kingpin.v2" ) diff --git a/collector/fsrmquota.go b/collector/fsrmquota.go index 29edec20..23c7c097 100644 --- a/collector/fsrmquota.go +++ b/collector/fsrmquota.go @@ -2,8 +2,8 @@ package collector import ( "github.com/StackExchange/wmi" + "github.com/prometheus-community/windows_exporter/log" "github.com/prometheus/client_golang/prometheus" - "github.com/prometheus/common/log" ) func init() { diff --git a/collector/hyperv.go b/collector/hyperv.go index 5f476390..279b4894 100644 --- a/collector/hyperv.go +++ b/collector/hyperv.go @@ -6,8 +6,8 @@ import ( "strings" "github.com/StackExchange/wmi" + "github.com/prometheus-community/windows_exporter/log" "github.com/prometheus/client_golang/prometheus" - "github.com/prometheus/common/log" ) func init() { diff --git a/collector/iis.go b/collector/iis.go index b1b0ebe0..daba9ad3 100644 --- a/collector/iis.go +++ b/collector/iis.go @@ -10,8 +10,8 @@ import ( "golang.org/x/sys/windows/registry" "github.com/StackExchange/wmi" + "github.com/prometheus-community/windows_exporter/log" "github.com/prometheus/client_golang/prometheus" - "github.com/prometheus/common/log" "gopkg.in/alecthomas/kingpin.v2" ) diff --git a/collector/logical_disk.go b/collector/logical_disk.go index d6e391de..2f9d8eea 100644 --- a/collector/logical_disk.go +++ b/collector/logical_disk.go @@ -6,8 +6,8 @@ import ( "fmt" "regexp" + "github.com/prometheus-community/windows_exporter/log" "github.com/prometheus/client_golang/prometheus" - "github.com/prometheus/common/log" "gopkg.in/alecthomas/kingpin.v2" ) diff --git a/collector/logon.go b/collector/logon.go index d6a4919a..df82f66e 100644 --- a/collector/logon.go +++ b/collector/logon.go @@ -6,8 +6,8 @@ import ( "errors" "github.com/StackExchange/wmi" + "github.com/prometheus-community/windows_exporter/log" "github.com/prometheus/client_golang/prometheus" - "github.com/prometheus/common/log" ) func init() { diff --git a/collector/memory.go b/collector/memory.go index 29aecf7f..82617e37 100644 --- a/collector/memory.go +++ b/collector/memory.go @@ -6,8 +6,8 @@ package collector import ( + "github.com/prometheus-community/windows_exporter/log" "github.com/prometheus/client_golang/prometheus" - "github.com/prometheus/common/log" ) func init() { diff --git a/collector/msmq.go b/collector/msmq.go index 16572a8c..fc4d2e99 100644 --- a/collector/msmq.go +++ b/collector/msmq.go @@ -6,8 +6,8 @@ import ( "strings" "github.com/StackExchange/wmi" + "github.com/prometheus-community/windows_exporter/log" "github.com/prometheus/client_golang/prometheus" - "github.com/prometheus/common/log" "gopkg.in/alecthomas/kingpin.v2" ) diff --git a/collector/mssql.go b/collector/mssql.go index d4af0131..e243589c 100644 --- a/collector/mssql.go +++ b/collector/mssql.go @@ -10,8 +10,8 @@ import ( "sync" "time" + "github.com/prometheus-community/windows_exporter/log" "github.com/prometheus/client_golang/prometheus" - "github.com/prometheus/common/log" "golang.org/x/sys/windows/registry" "gopkg.in/alecthomas/kingpin.v2" ) diff --git a/collector/net.go b/collector/net.go index 3bbe0bdb..ccd82018 100644 --- a/collector/net.go +++ b/collector/net.go @@ -6,8 +6,8 @@ import ( "fmt" "regexp" + "github.com/prometheus-community/windows_exporter/log" "github.com/prometheus/client_golang/prometheus" - "github.com/prometheus/common/log" "gopkg.in/alecthomas/kingpin.v2" ) diff --git a/collector/netframework_clrexceptions.go b/collector/netframework_clrexceptions.go index ffced912..53d80b16 100644 --- a/collector/netframework_clrexceptions.go +++ b/collector/netframework_clrexceptions.go @@ -4,8 +4,8 @@ package collector import ( "github.com/StackExchange/wmi" + "github.com/prometheus-community/windows_exporter/log" "github.com/prometheus/client_golang/prometheus" - "github.com/prometheus/common/log" ) func init() { diff --git a/collector/netframework_clrinterop.go b/collector/netframework_clrinterop.go index 78171919..483d799a 100644 --- a/collector/netframework_clrinterop.go +++ b/collector/netframework_clrinterop.go @@ -4,8 +4,8 @@ package collector import ( "github.com/StackExchange/wmi" + "github.com/prometheus-community/windows_exporter/log" "github.com/prometheus/client_golang/prometheus" - "github.com/prometheus/common/log" ) func init() { diff --git a/collector/netframework_clrjit.go b/collector/netframework_clrjit.go index fb3d4c2a..da24e1c4 100644 --- a/collector/netframework_clrjit.go +++ b/collector/netframework_clrjit.go @@ -4,8 +4,8 @@ package collector import ( "github.com/StackExchange/wmi" + "github.com/prometheus-community/windows_exporter/log" "github.com/prometheus/client_golang/prometheus" - "github.com/prometheus/common/log" ) func init() { diff --git a/collector/netframework_clrloading.go b/collector/netframework_clrloading.go index aba0921c..bc28ce87 100644 --- a/collector/netframework_clrloading.go +++ b/collector/netframework_clrloading.go @@ -4,8 +4,8 @@ package collector import ( "github.com/StackExchange/wmi" + "github.com/prometheus-community/windows_exporter/log" "github.com/prometheus/client_golang/prometheus" - "github.com/prometheus/common/log" ) func init() { diff --git a/collector/netframework_clrlocksandthreads.go b/collector/netframework_clrlocksandthreads.go index e446eaa2..5d236a80 100644 --- a/collector/netframework_clrlocksandthreads.go +++ b/collector/netframework_clrlocksandthreads.go @@ -4,8 +4,8 @@ package collector import ( "github.com/StackExchange/wmi" + "github.com/prometheus-community/windows_exporter/log" "github.com/prometheus/client_golang/prometheus" - "github.com/prometheus/common/log" ) func init() { diff --git a/collector/netframework_clrmemory.go b/collector/netframework_clrmemory.go index 407edde8..7318161e 100644 --- a/collector/netframework_clrmemory.go +++ b/collector/netframework_clrmemory.go @@ -4,8 +4,8 @@ package collector import ( "github.com/StackExchange/wmi" + "github.com/prometheus-community/windows_exporter/log" "github.com/prometheus/client_golang/prometheus" - "github.com/prometheus/common/log" ) func init() { diff --git a/collector/netframework_clrremoting.go b/collector/netframework_clrremoting.go index 9da318a7..4d8a1a41 100644 --- a/collector/netframework_clrremoting.go +++ b/collector/netframework_clrremoting.go @@ -4,8 +4,8 @@ package collector import ( "github.com/StackExchange/wmi" + "github.com/prometheus-community/windows_exporter/log" "github.com/prometheus/client_golang/prometheus" - "github.com/prometheus/common/log" ) func init() { diff --git a/collector/netframework_clrsecurity.go b/collector/netframework_clrsecurity.go index 1ea0ded1..4ae6347c 100644 --- a/collector/netframework_clrsecurity.go +++ b/collector/netframework_clrsecurity.go @@ -4,8 +4,8 @@ package collector import ( "github.com/StackExchange/wmi" + "github.com/prometheus-community/windows_exporter/log" "github.com/prometheus/client_golang/prometheus" - "github.com/prometheus/common/log" ) func init() { diff --git a/collector/os.go b/collector/os.go index 45486ace..f9db5796 100644 --- a/collector/os.go +++ b/collector/os.go @@ -7,8 +7,8 @@ import ( "time" "github.com/StackExchange/wmi" + "github.com/prometheus-community/windows_exporter/log" "github.com/prometheus/client_golang/prometheus" - "github.com/prometheus/common/log" ) func init() { diff --git a/collector/perflib.go b/collector/perflib.go index 19ce2ad7..153429e6 100644 --- a/collector/perflib.go +++ b/collector/perflib.go @@ -7,7 +7,7 @@ import ( perflibCollector "github.com/leoluk/perflib_exporter/collector" "github.com/leoluk/perflib_exporter/perflib" - "github.com/prometheus/common/log" + "github.com/prometheus-community/windows_exporter/log" ) var nametable = perflib.QueryNameTable("Counter 009") // Reads the names in English TODO: validate that the English names are always present diff --git a/collector/process.go b/collector/process.go index 306bddf2..29d02416 100644 --- a/collector/process.go +++ b/collector/process.go @@ -9,8 +9,8 @@ import ( "strings" "github.com/StackExchange/wmi" + "github.com/prometheus-community/windows_exporter/log" "github.com/prometheus/client_golang/prometheus" - "github.com/prometheus/common/log" "gopkg.in/alecthomas/kingpin.v2" ) diff --git a/collector/remote_fx.go b/collector/remote_fx.go index f81066f7..3654ccf9 100644 --- a/collector/remote_fx.go +++ b/collector/remote_fx.go @@ -5,8 +5,8 @@ package collector import ( "strings" + "github.com/prometheus-community/windows_exporter/log" "github.com/prometheus/client_golang/prometheus" - "github.com/prometheus/common/log" ) func init() { diff --git a/collector/service.go b/collector/service.go index a5b50c65..86dd1251 100644 --- a/collector/service.go +++ b/collector/service.go @@ -7,8 +7,8 @@ import ( "strings" "github.com/StackExchange/wmi" + "github.com/prometheus-community/windows_exporter/log" "github.com/prometheus/client_golang/prometheus" - "github.com/prometheus/common/log" "gopkg.in/alecthomas/kingpin.v2" ) diff --git a/collector/smtp.go b/collector/smtp.go index 70eb6b3a..ccf6abab 100644 --- a/collector/smtp.go +++ b/collector/smtp.go @@ -4,8 +4,8 @@ package collector import ( "fmt" + "github.com/prometheus-community/windows_exporter/log" "github.com/prometheus/client_golang/prometheus" - "github.com/prometheus/common/log" "gopkg.in/alecthomas/kingpin.v2" "regexp" ) diff --git a/collector/system.go b/collector/system.go index a4eec8ab..d76f9b87 100644 --- a/collector/system.go +++ b/collector/system.go @@ -3,8 +3,8 @@ package collector import ( + "github.com/prometheus-community/windows_exporter/log" "github.com/prometheus/client_golang/prometheus" - "github.com/prometheus/common/log" ) func init() { diff --git a/collector/tcp.go b/collector/tcp.go index e9d2adce..879aaa91 100644 --- a/collector/tcp.go +++ b/collector/tcp.go @@ -3,8 +3,8 @@ package collector import ( + "github.com/prometheus-community/windows_exporter/log" "github.com/prometheus/client_golang/prometheus" - "github.com/prometheus/common/log" ) func init() { diff --git a/collector/terminal_services.go b/collector/terminal_services.go index 1d02d97a..564631fe 100644 --- a/collector/terminal_services.go +++ b/collector/terminal_services.go @@ -7,8 +7,8 @@ import ( "strings" "github.com/StackExchange/wmi" + "github.com/prometheus-community/windows_exporter/log" "github.com/prometheus/client_golang/prometheus" - "github.com/prometheus/common/log" ) const ConnectionBrokerFeatureID uint32 = 133 diff --git a/collector/textfile.go b/collector/textfile.go index 6881a7ca..767f58bf 100644 --- a/collector/textfile.go +++ b/collector/textfile.go @@ -26,10 +26,10 @@ import ( "time" "github.com/dimchansky/utfbom" + "github.com/prometheus-community/windows_exporter/log" "github.com/prometheus/client_golang/prometheus" dto "github.com/prometheus/client_model/go" "github.com/prometheus/common/expfmt" - "github.com/prometheus/common/log" kingpin "gopkg.in/alecthomas/kingpin.v2" ) diff --git a/collector/thermalzone.go b/collector/thermalzone.go index baf6ec8b..c76cdf84 100644 --- a/collector/thermalzone.go +++ b/collector/thermalzone.go @@ -2,8 +2,8 @@ package collector import ( "github.com/StackExchange/wmi" + "github.com/prometheus-community/windows_exporter/log" "github.com/prometheus/client_golang/prometheus" - "github.com/prometheus/common/log" ) func init() { diff --git a/collector/time.go b/collector/time.go index dd1eee42..b8c66d09 100644 --- a/collector/time.go +++ b/collector/time.go @@ -5,8 +5,8 @@ package collector import ( "errors" + "github.com/prometheus-community/windows_exporter/log" "github.com/prometheus/client_golang/prometheus" - "github.com/prometheus/common/log" ) func init() { diff --git a/collector/vmware.go b/collector/vmware.go index acecbf1b..2c59b657 100644 --- a/collector/vmware.go +++ b/collector/vmware.go @@ -6,8 +6,8 @@ import ( "errors" "github.com/StackExchange/wmi" + "github.com/prometheus-community/windows_exporter/log" "github.com/prometheus/client_golang/prometheus" - "github.com/prometheus/common/log" ) func init() { diff --git a/collector/wmi.go b/collector/wmi.go index 615db1f7..3654cfb0 100644 --- a/collector/wmi.go +++ b/collector/wmi.go @@ -4,7 +4,7 @@ import ( "bytes" "reflect" - "github.com/prometheus/common/log" + "github.com/prometheus-community/windows_exporter/log" ) func className(src interface{}) string { diff --git a/config/config.go b/config/config.go index 1fde1587..b0ff31ce 100644 --- a/config/config.go +++ b/config/config.go @@ -17,7 +17,7 @@ import ( "io/ioutil" "os" - "github.com/prometheus/common/log" + "github.com/prometheus-community/windows_exporter/log" "gopkg.in/alecthomas/kingpin.v2" "gopkg.in/yaml.v2" ) diff --git a/exporter.go b/exporter.go index 58af56c6..2a2a19b8 100644 --- a/exporter.go +++ b/exporter.go @@ -19,9 +19,9 @@ import ( "github.com/StackExchange/wmi" "github.com/prometheus-community/windows_exporter/collector" "github.com/prometheus-community/windows_exporter/config" + "github.com/prometheus-community/windows_exporter/log" "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" "gopkg.in/alecthomas/kingpin.v2" diff --git a/go.mod b/go.mod index 0bd9727b..a165f5dc 100644 --- a/go.mod +++ b/go.mod @@ -14,6 +14,7 @@ require ( 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