deprecate use of spew so package is a go primitive
This commit is contained in:
parent
9b12c5049e
commit
e1d7a5c2cc
9
Makefile
9
Makefile
|
@ -1,8 +1,11 @@
|
||||||
# git remote add github git@github.com:wit-go/log.git
|
# git remote add github git@github.com:wit-go/log.git
|
||||||
|
|
||||||
all:
|
all: vet
|
||||||
#@GO111MODULE=off go vet -x
|
@#GO111MODULE=off go vet -x
|
||||||
GO111MODULE=off go vet
|
@echo this go library builds ok
|
||||||
|
|
||||||
|
vet:
|
||||||
|
@GO111MODULE=off go vet
|
||||||
|
|
||||||
redomod:
|
redomod:
|
||||||
rm -f go.*
|
rm -f go.*
|
||||||
|
|
45
spew.go
45
spew.go
|
@ -1,45 +0,0 @@
|
||||||
// Copyright 2024 The Go Authors. All rights reserved.
|
|
||||||
// Use of this source code is governed by a BSD-style
|
|
||||||
// license that can be found in the LICENSE file.
|
|
||||||
|
|
||||||
package log
|
|
||||||
|
|
||||||
import (
|
|
||||||
"go.wit.com/dev/davecgh/spew"
|
|
||||||
)
|
|
||||||
|
|
||||||
func Spew(b any, a ...any) {
|
|
||||||
if !SPEW.Ok() {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
if !SPEW.b {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
switch b.(type) {
|
|
||||||
case bool:
|
|
||||||
if !b.(bool) {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
realPrintln("SPEW:", spew.Sdump(a...))
|
|
||||||
case LogFlag:
|
|
||||||
var f LogFlag
|
|
||||||
f = b.(LogFlag)
|
|
||||||
if !f.b {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
realPrintln("SPEW:", spew.Sdump(a...))
|
|
||||||
default:
|
|
||||||
realPrintln("SPEW b:", spew.Sdump(b))
|
|
||||||
realPrintln("SPEW a:", spew.Sdump(a...))
|
|
||||||
}
|
|
||||||
// realPrintln("SPEW:", spew.Sdump(a...))
|
|
||||||
/*
|
|
||||||
scs := spew.ConfigState{Indent: "\t", MaxDepth: 1}
|
|
||||||
// Output using the ConfigState instance.
|
|
||||||
v := map[string]int{"one": 1}
|
|
||||||
scs.Printf("v: %v\n", v)
|
|
||||||
scs.Dump(v)
|
|
||||||
scs.Dump(a)
|
|
||||||
*/
|
|
||||||
}
|
|
Loading…
Reference in New Issue