2024-01-03 11:18:56 -06:00
|
|
|
package debugger
|
|
|
|
|
|
|
|
// initializes logging and command line options
|
|
|
|
|
|
|
|
import (
|
2024-01-15 16:55:17 -06:00
|
|
|
"go.wit.com/dev/alexflint/arg"
|
2024-01-03 22:10:13 -06:00
|
|
|
"go.wit.com/log"
|
2024-01-03 11:18:56 -06:00
|
|
|
)
|
|
|
|
|
2024-01-08 23:53:34 -06:00
|
|
|
var INFO *log.LogFlag
|
|
|
|
var POLL *log.LogFlag
|
|
|
|
var CHAN *log.LogFlag
|
|
|
|
var WARN *log.LogFlag
|
2024-01-08 22:33:18 -06:00
|
|
|
|
2024-01-03 11:18:56 -06:00
|
|
|
var argDebugger ArgsDebugger
|
|
|
|
|
|
|
|
// This struct can be used with the go-arg package
|
|
|
|
type ArgsDebugger struct {
|
|
|
|
Debugger bool `arg:"--debugger" help:"open the debugger window"`
|
|
|
|
}
|
|
|
|
|
2024-01-03 13:25:47 -06:00
|
|
|
// returns true if --gui-debug was passed from the command line
|
|
|
|
func ArgDebug() bool {
|
|
|
|
return argDebugger.Debugger
|
|
|
|
}
|
|
|
|
|
2024-01-03 11:18:56 -06:00
|
|
|
func init() {
|
|
|
|
arg.Register(&argDebugger)
|
|
|
|
|
2024-01-18 01:34:32 -06:00
|
|
|
full := "go.wit.com/bug/debugger"
|
2024-01-08 22:33:18 -06:00
|
|
|
short := "bugger"
|
|
|
|
|
2024-01-08 23:53:34 -06:00
|
|
|
INFO = log.NewFlag("INFO", false, full, short, "simple debugging Info()")
|
|
|
|
POLL = log.NewFlag("POLL", false, full, short, "watch the debugger poll things")
|
2024-01-18 01:34:32 -06:00
|
|
|
CHAN = log.NewFlag("CHAN", true, full, short, "chan() test code output")
|
|
|
|
WARN = log.NewFlag("WARN", true, full, short, "should warn the user")
|
2024-01-03 11:18:56 -06:00
|
|
|
}
|