feat(config): add debug server configuration options

- Add debug server listen address and port configuration in config.json and config.go
- Update main.go to use debug config values when in debug mode
- Add logging for monitor add/remove commands in commandParse.go
This commit is contained in:
2026-04-07 23:06:19 +08:00
parent 75639bcf96
commit 6770bbed3f
4 changed files with 29 additions and 2 deletions

View File

@@ -10,6 +10,10 @@ import (
var Config struct {
DebugMode bool `json:"debugMode"`
Debug struct {
ListenAddr string `json:"listenAddr"`
ListenPort int `json:"listenPort"`
} `json:"debug"`
}
func loadConfig() {
@@ -26,4 +30,15 @@ func loadConfig() {
if Config.DebugMode {
isDebug = true
}
if Config.Debug.ListenAddr != "" {
DebugListenAddr = Config.Debug.ListenAddr
} else {
DebugListenAddr = "0.0.0.0"
}
if Config.Debug.ListenPort != 0 {
DebugListenPort = Config.Debug.ListenPort
} else {
DebugListenPort = 10080
}
}