summaryrefslogtreecommitdiff
path: root/log/log.go
diff options
context:
space:
mode:
Diffstat (limited to 'log/log.go')
-rw-r--r--log/log.go12
1 files changed, 12 insertions, 0 deletions
diff --git a/log/log.go b/log/log.go
index 9862291..d460539 100644
--- a/log/log.go
+++ b/log/log.go
@@ -23,6 +23,7 @@ import (
"runtime"
"runtime/pprof"
golog "log"
+ "fmt"
"time"
"reflect"
"github.com/davecgh/go-spew/spew"
@@ -42,6 +43,8 @@ var debugToolkit bool = false // does spew stuff?
var Where string = "gui/log"
+var externalLog func(...any)
+
type Spewt struct {
a bool
}
@@ -126,6 +129,11 @@ func Log(a ...any) {
}
golog.Println(a...)
+ if (externalLog == nil) {
+ // golog.Println(a...)
+ } else {
+ externalLog(fmt.Sprint(a...))
+ }
}
func loggo() {
@@ -147,3 +155,7 @@ func logindent(depth int, format string, a ...interface{}) {
func SetOutput(f *os.File) {
golog.SetOutput(f)
}
+
+func SetToolkitOutput(newLog func(...any)) {
+ externalLog = newLog
+}