mirror of
https://github.com/router-for-me/CLIProxyAPI.git
synced 2026-02-02 04:20:50 +08:00
Add dynamic log level adjustment and "type" field to auth files response
- Introduced `SetLogLevel` utility function for unified log level management. - Updated dynamic log level handling across server and watcher components. - Extended auth files response by extracting and including the `type` field from file content. - Updated management API documentation with the new `type` field in auth files response.
This commit is contained in:
@@ -14,6 +14,7 @@ import (
|
||||
"github.com/luispater/CLIProxyAPI/internal/cmd"
|
||||
"github.com/luispater/CLIProxyAPI/internal/config"
|
||||
_ "github.com/luispater/CLIProxyAPI/internal/translator"
|
||||
"github.com/luispater/CLIProxyAPI/internal/util"
|
||||
log "github.com/sirupsen/logrus"
|
||||
)
|
||||
|
||||
@@ -112,11 +113,7 @@ func main() {
|
||||
}
|
||||
|
||||
// Set the log level based on the configuration.
|
||||
if cfg.Debug {
|
||||
log.SetLevel(log.DebugLevel)
|
||||
} else {
|
||||
log.SetLevel(log.InfoLevel)
|
||||
}
|
||||
util.SetLogLevel(cfg)
|
||||
|
||||
// Expand the tilde (~) in the auth directory path to the user's home directory.
|
||||
if strings.HasPrefix(cfg.AuthDir, "~") {
|
||||
|
||||
Reference in New Issue
Block a user