feat: add foreground mode, pause/resume commands, API docs

This commit is contained in:
2026-03-25 00:12:14 +08:00
parent b00f95b7fb
commit 8ce1e6531a
8 changed files with 502 additions and 76 deletions

View File

@@ -34,6 +34,24 @@ func InitLogger() error {
return nil
}
func SwitchToFrontLog() {
if fileLogger != nil {
fileLogger.Close()
}
logDir := config.GetLogDir()
if err := os.MkdirAll(logDir, 0755); err != nil {
logDir = "logs"
}
logFile := filepath.Join(logDir, "network_monitor_front.log")
fileLogger = &lumberjack.Logger{
Filename: logFile,
MaxSize: 10,
MaxBackups: 30,
MaxAge: 30,
Compress: false,
}
}
func EnableDebug() {
debugEnabled = true
}