Refactor logging to use slog package across the application

- Replaced standard log package with log/slog in httpclient, nginx manager, sync service, updater, and other components for structured logging.
- Introduced environment variable `LOG_LEVEL` to control logging levels (debug, info, warn, error).
- Updated documentation to reflect changes in logging configuration and requirements.
- Added a new logging setup function in the ats_agent internal package to initialize the slog logger.
This commit is contained in:
ryan
2026-03-13 14:53:51 +08:00
parent 06d4831d55
commit aeb7118b30
17 changed files with 321 additions and 209 deletions
+2 -3
View File
@@ -4,7 +4,6 @@ import (
"fmt"
"github.com/google/uuid"
"html/template"
"log"
"net"
"os/exec"
"runtime"
@@ -24,14 +23,14 @@ func OpenBrowser(url string) {
err = exec.Command("open", url).Start()
}
if err != nil {
log.Println(err)
SysError(err.Error())
}
}
func GetIp() (ip string) {
ips, err := net.InterfaceAddrs()
if err != nil {
log.Println(err)
SysError(err.Error())
return ip
}