2023-12-30 20:48:24 -06:00
|
|
|
package log
|
|
|
|
|
|
|
|
import (
|
|
|
|
origlog "log"
|
|
|
|
"github.com/davecgh/go-spew/spew"
|
|
|
|
)
|
|
|
|
|
2023-12-31 19:44:55 -06:00
|
|
|
func Spew(b any, a ...any) {
|
|
|
|
if ! SPEW.b { return }
|
2023-12-30 20:48:24 -06:00
|
|
|
|
2023-12-31 19:44:55 -06:00
|
|
|
switch b.(type) {
|
|
|
|
case bool:
|
|
|
|
if ! b.(bool) {
|
|
|
|
return
|
|
|
|
}
|
|
|
|
origlog.Println("SPEW:", spew.Sdump(a...))
|
|
|
|
case logFlag:
|
|
|
|
var f logFlag
|
|
|
|
f = b.(logFlag)
|
|
|
|
if ! f.b {
|
|
|
|
return
|
|
|
|
}
|
|
|
|
origlog.Println("SPEW:", spew.Sdump(a...))
|
|
|
|
default:
|
|
|
|
origlog.Println("SPEW b:", spew.Sdump(b))
|
|
|
|
origlog.Println("SPEW a:", spew.Sdump(a...))
|
|
|
|
}
|
|
|
|
// origlog.Println("SPEW:", spew.Sdump(a...))
|
2023-12-30 20:48:24 -06:00
|
|
|
/*
|
|
|
|
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)
|
|
|
|
*/
|
|
|
|
}
|