add engineDebug and stateDebug flags

This commit is contained in:
Alfred Kamanda 2024-09-24 14:10:10 +03:00
parent 8a03b05c90
commit b8852e1ab3
Signed by: Alfred-mk
GPG Key ID: 7EA3D01708908703

View File

@ -23,10 +23,12 @@ func main() {
var dbDir string var dbDir string
var size uint var size uint
var sessionId string var sessionId string
var debug bool var engineDebug bool
var stateDebug bool
flag.StringVar(&sessionId, "session-id", "075xx2123", "session id") flag.StringVar(&sessionId, "session-id", "075xx2123", "session id")
flag.StringVar(&dbDir, "dbdir", ".state", "database dir to read from") flag.StringVar(&dbDir, "dbdir", ".state", "database dir to read from")
flag.BoolVar(&debug, "d", false, "use engine debug output") flag.BoolVar(&engineDebug, "engine-debug", false, "use engine debug output")
flag.BoolVar(&stateDebug, "state-debug", false, "use engine debug output")
flag.UintVar(&size, "s", 160, "max size of output") flag.UintVar(&size, "s", 160, "max size of output")
flag.Parse() flag.Parse()
@ -43,6 +45,10 @@ func main() {
FlagCount: uint32(16), FlagCount: uint32(16),
} }
if stateDebug {
cfg.StateDebug = true
}
resourceDir := scriptDir resourceDir := scriptDir
menuStorageService := storage.NewMenuStorageService(dbDir, resourceDir) menuStorageService := storage.NewMenuStorageService(dbDir, resourceDir)
@ -93,7 +99,7 @@ func main() {
en := lhs.GetEngine() en := lhs.GetEngine()
en = en.WithFirst(hl.Init) en = en.WithFirst(hl.Init)
if debug { if engineDebug {
en = en.WithDebug(nil) en = en.WithDebug(nil)
} }