mirror of
https://github.com/router-for-me/CLIProxyAPI.git
synced 2026-02-03 04:50:52 +08:00
feat(logging): introduce centralized logging with custom format and Gin integration
- Implemented a global logger with structured formatting for consistent log output. - Added support for rotating log files using Lumberjack. - Integrated new logging functionality with Gin HTTP server for unified log handling. - Replaced direct `log.Info` calls with `fmt.Printf` in non-critical paths to simplify core functionality.
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
package misc
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"path/filepath"
|
||||
"strings"
|
||||
|
||||
@@ -15,7 +16,7 @@ func LogSavingCredentials(path string) {
|
||||
return
|
||||
}
|
||||
// Use filepath.Clean so logs remain stable even if callers pass redundant separators.
|
||||
log.Infof("Saving credentials to %s", filepath.Clean(path))
|
||||
fmt.Printf("Saving credentials to %s\n", filepath.Clean(path))
|
||||
}
|
||||
|
||||
// LogCredentialSeparator adds a visual separator to group auth/key processing logs.
|
||||
|
||||
Reference in New Issue
Block a user