diff --git a/log/go.mod b/log/go.mod index 326a78022d94..564ceb381a43 100644 --- a/log/go.mod +++ b/log/go.mod @@ -1,3 +1,11 @@ module github.com/cosmos/cosmos-sdk/log go 1.19 + +require github.com/cometbft/cometbft v0.0.0-20230202201700-d159562d0d96 + +require ( + github.com/go-kit/log v0.2.1 // indirect + github.com/go-logfmt/logfmt v0.5.1 // indirect + github.com/pkg/errors v0.9.1 // indirect +) diff --git a/log/go.sum b/log/go.sum new file mode 100644 index 000000000000..b8f72dac6ba9 --- /dev/null +++ b/log/go.sum @@ -0,0 +1,12 @@ +github.com/cometbft/cometbft v0.0.0-20230202201700-d159562d0d96 h1:IRiCr0VpGdF5uIokdeUOdleG1zCIfuAtmCSgdvp1Ay0= +github.com/cometbft/cometbft v0.0.0-20230202201700-d159562d0d96/go.mod h1:OzbxTW/3VRke0yIK8OmfVcRlF7cDkk0nu0XM/aw72FI= +github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= +github.com/go-kit/log v0.2.1 h1:MRVx0/zhvdseW+Gza6N9rVzU/IVzaeE1SFI4raAhmBU= +github.com/go-kit/log v0.2.1/go.mod h1:NwTd00d/i8cPZ3xOwwiv2PO5MOcx78fFErGNcVmBjv0= +github.com/go-logfmt/logfmt v0.5.1 h1:otpy5pqBCBZ1ng9RQ0dPu4PN7ba75Y/aA+UpowDyNVA= +github.com/go-logfmt/logfmt v0.5.1/go.mod h1:WYhtIu8zTZfxdn5+rREduYbwxfcBr/Vr6KEVveWlfTs= +github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= +github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= +github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= +github.com/stretchr/testify v1.8.1 h1:w7B6lhMri9wdJUVmEZPGGhZzrYTPvgJArz7wNPgYKsk= +gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= diff --git a/log/logger.go b/log/logger.go index dad40a943711..cfe951841cce 100644 --- a/log/logger.go +++ b/log/logger.go @@ -1,10 +1,12 @@ package log +import cmlog "github.com/cometbft/cometbft/libs/log" + // Logger is the interface that wraps the basic logging methods. type Logger interface { Debug(msg string, keyvals ...interface{}) Info(msg string, keyvals ...interface{}) Error(msg string, keyvals ...interface{}) - With(keyvals ...interface{}) Logger + With(keyvals ...interface{}) cmlog.Logger } diff --git a/log/noop_logger.go b/log/noop_logger.go index 026eebe4915f..feedd5719070 100644 --- a/log/noop_logger.go +++ b/log/noop_logger.go @@ -1,5 +1,7 @@ package log +import cmlog "github.com/cometbft/cometbft/libs/log" + var _ Logger = &NoOp{} type NoOp struct{} @@ -12,6 +14,6 @@ func (l NoOp) Debug(msg string, keyvals ...interface{}) {} func (l NoOp) Info(msg string, keyvals ...interface{}) {} func (l NoOp) Error(msg string, keyvals ...interface{}) {} -func (l NoOp) With(i ...interface{}) Logger { +func (l NoOp) With(i ...interface{}) cmlog.Logger { return l }