chore: update logging

This commit is contained in:
Siyuan Miao
2025-04-11 12:55:36 +02:00
parent 924b55059f
commit 0ba7902f82
13 changed files with 246 additions and 105 deletions

View File

@@ -93,6 +93,7 @@ type Config struct {
TLSMode string `json:"tls_mode"` // options: "self-signed", "user-defined", ""
UsbConfig *usbgadget.Config `json:"usb_config"`
UsbDevices *usbgadget.Devices `json:"usb_devices"`
DefaultLogLevel string `json:"default_log_level"`
}
const configPath = "/userdata/kvm_config.json"
@@ -120,6 +121,7 @@ var defaultConfig = &Config{
Keyboard: true,
MassStorage: true,
},
DefaultLogLevel: "INFO",
}
var (
@@ -163,6 +165,8 @@ func LoadConfig() {
}
config = &loadedConfig
rootLogger.UpdateLogLevel()
}
func SaveConfig() error {