mirror of
https://github.com/coalaura/whiskr.git
synced 2025-09-09 17:29:54 +00:00
better search tools
This commit is contained in:
16
debug.go
16
debug.go
@@ -1,23 +1,17 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"os"
|
||||
)
|
||||
|
||||
func dump(v any) {
|
||||
func debug(format string, args ...any) {
|
||||
if !Debug {
|
||||
return
|
||||
}
|
||||
|
||||
b, _ := json.MarshalIndent(v, "", "\t")
|
||||
os.WriteFile("debug.json", b, 0644)
|
||||
log.Debugf(format+"\n", args...)
|
||||
}
|
||||
|
||||
func debug(v any) {
|
||||
if !Debug {
|
||||
func debugIf(cond bool, format string, args ...any) {
|
||||
if !cond {
|
||||
return
|
||||
}
|
||||
|
||||
log.Debugf("%#v\n", v)
|
||||
debug(format, args)
|
||||
}
|
||||
|
Reference in New Issue
Block a user