diff --git a/go.mod b/go.mod index a4f5dcb0fd291428ec3740d8cfca9b06023518ba..eb7aa838329348e82068e3be8d13c671261f1e5b 100644 --- a/go.mod +++ b/go.mod @@ -10,6 +10,7 @@ require ( github.com/aymerick/raymond v2.0.2+incompatible github.com/boltdb/bolt v1.3.1 github.com/codenotary/immudb v1.5.0 + github.com/davecgh/go-spew v1.1.1 github.com/denisenkom/go-mssqldb v0.12.3 github.com/dgraph-io/dgo/v2 v2.2.0 github.com/dgrijalva/jwt-go v3.2.0+incompatible @@ -32,7 +33,6 @@ require ( github.com/processout/grpc-go-pool v1.2.1 github.com/qiangxue/fasthttp-routing v0.0.0-20160225050629-6ccdc2a18d87 github.com/segmentio/ksuid v1.0.4 - github.com/shurcooL/go-goon v1.0.0 github.com/stretchr/testify v1.8.4 github.com/tidwall/buntdb v1.3.0 github.com/tidwall/gjson v1.16.0 @@ -60,7 +60,6 @@ require ( github.com/bytedance/sonic v1.9.1 // indirect github.com/cespare/xxhash/v2 v2.2.0 // indirect github.com/chenzhuoyu/base64x v0.0.0-20221115062448-fe3a3abad311 // indirect - github.com/davecgh/go-spew v1.1.1 // indirect github.com/fsnotify/fsnotify v1.6.0 // indirect github.com/gabriel-vasile/mimetype v1.4.2 // indirect github.com/gin-contrib/sse v0.1.0 // indirect @@ -98,7 +97,6 @@ require ( github.com/prometheus/procfs v0.7.3 // indirect github.com/rogpeppe/go-internal v1.9.0 // indirect github.com/rs/xid v1.5.0 // indirect - github.com/shurcooL/go v0.0.0-20200502201357-93f07166e636 // indirect github.com/spf13/afero v1.9.3 // indirect github.com/spf13/cast v1.5.0 // indirect github.com/spf13/cobra v1.6.1 // indirect diff --git a/go.sum b/go.sum index 17a90e4733d7609e5cc3ade36590169d5a824e81..f9f3507b18febb1bc5ffdcbe5150cfcf6bded528 100644 --- a/go.sum +++ b/go.sum @@ -390,10 +390,6 @@ github.com/rs/xid v1.5.0/go.mod h1:trrq9SKmegXys3aeAKXMUTdJsYXVwGY3RLcfgqegfbg= github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= github.com/segmentio/ksuid v1.0.4 h1:sBo2BdShXjmcugAMwjugoGUdUV0pcxY5mW4xKRn3v4c= github.com/segmentio/ksuid v1.0.4/go.mod h1:/XUiZBD3kVx5SmUOl55voK5yeAbBNNIed+2O73XgrPE= -github.com/shurcooL/go v0.0.0-20200502201357-93f07166e636 h1:aSISeOcal5irEhJd1M+IrApc0PdcN7e7Aj4yuEnOrfQ= -github.com/shurcooL/go v0.0.0-20200502201357-93f07166e636/go.mod h1:TDJrrUr11Vxrven61rcy3hJMUqaf/CLWYhHNPmT14Lk= -github.com/shurcooL/go-goon v1.0.0 h1:BCQPvxGkHHJ4WpBO4m/9FXbITVIsvAm/T66cCcCGI7E= -github.com/shurcooL/go-goon v1.0.0/go.mod h1:2wTHMsGo7qnpmqA8ADYZtP4I1DD94JpXGQ3Dxq2YQ5w= github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= github.com/sirupsen/logrus v1.6.0/go.mod h1:7uNnSEd1DgxDLC74fIahvMZmmYsHGZGEOFrfsX/uA88= diff --git a/loggermdl/loggerdefault.go b/loggermdl/loggerdefault.go index 7e37e67bfbc94a869d44af831dcd0a278324c2b0..2ae30fdabc3cd15435c027eff6323ec9ae8b1a50 100755 --- a/loggermdl/loggerdefault.go +++ b/loggermdl/loggerdefault.go @@ -1,3 +1,4 @@ +//go:build !prod // +build !prod //@author Ajit Jagtap @@ -10,8 +11,8 @@ import ( "fmt" "os" + spew "github.com/davecgh/go-spew/spew" logging "github.com/op/go-logging" - goon "github.com/shurcooL/go-goon" ) var log = logging.MustGetLogger("mkcllogger") @@ -53,7 +54,7 @@ func LogError(args ...interface{}) { // LogPanic logs a message at level Panic on the standard logger. func LogPanic(args ...interface{}) { - log.Panic(args) + log.Panic(args...) } // // LogJSONObject Format string @@ -113,7 +114,7 @@ func LogSpot(args ...interface{}) { // LogVars Prints variables with formatting func LogVars(xvars ...interface{}) { for _, i := range xvars { - goon.Dump(i) + spew.Dump(i) } } diff --git a/loggermdl/loggerdefault_test.go b/loggermdl/loggerdefault_test.go index aa43f3fc660e4dc2c46b5763b619e99096acc36c..e0d61b60809bf9901334f867a459f35a1e2bf975 100755 --- a/loggermdl/loggerdefault_test.go +++ b/loggermdl/loggerdefault_test.go @@ -4,7 +4,6 @@ package loggermdl import ( - "encoding/json" "fmt" "testing" @@ -46,56 +45,56 @@ func ExampleLogDebug() { //Output: // } -func TestLogJSONString(t *testing.T) { - a := `{"Age": 1,"Name": "sometext"}` +// func TestLogJSONString(t *testing.T) { +// a := `{"Age": 1,"Name": "sometext"}` - assert.NotPanics(t, func() { LogJSONString(a) }, "The code did panic") +// assert.NotPanics(t, func() { LogJSONString(a) }, "The code did panic") - //Output2: - // { - // "Age": 1, - // "Name": "sometext" - // } -} +// //Output2: +// // { +// // "Age": 1, +// // "Name": "sometext" +// // } +// } func ExampleLogHREnd() { LogHREnd() //Output: //<<<<<<<<<<<<<<<<<<<<<<< } -func TestLogJSONObject(t *testing.T) { - type MySt struct { - Name string - Age int - } - m := MySt{"sometext", 1} - // jsonUnmarshal(json.Marshal(m), &m) - - assert.NotPanics(t, func() { LogJSONObject(m) }, "The code did panic") - //Output1: - //{ - // "Age": 1, - // "Name": "sometext" - //} -} +// func TestLogJSONObject(t *testing.T) { +// type MySt struct { +// Name string +// Age int +// } +// m := MySt{"sometext", 1} +// // jsonUnmarshal(json.Marshal(m), &m) + +// assert.NotPanics(t, func() { LogJSONObject(m) }, "The code did panic") +// //Output1: +// //{ +// // "Age": 1, +// // "Name": "sometext" +// //} +// } -func TestLogJSONByte(t *testing.T) { // func ExampleLogJSONByte() { +// func TestLogJSONByte(t *testing.T) { // func ExampleLogJSONByte() { - type MySt struct { - Name string - Age int - } - m := MySt{"sometext", 1} - a, _ := json.Marshal(m) +// type MySt struct { +// Name string +// Age int +// } +// m := MySt{"sometext", 1} +// a, _ := json.Marshal(m) - assert.NotPanics(t, func() { LogJSONByte(a) }, "The code did panic") - //Output1: - // { - // "Age": 1, - // "Name": "sometext" - // } +// assert.NotPanics(t, func() { LogJSONByte(a) }, "The code did panic") +// //Output1: +// // { +// // "Age": 1, +// // "Name": "sometext" +// // } -} +// } func ExampleLogHRStart() { LogHRStart() //Output: