mirror of
https://github.com/router-for-me/CLIProxyAPI.git
synced 2026-02-03 04:50:52 +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:
@@ -168,6 +168,14 @@ func (w *Watcher) reloadConfig() {
|
||||
w.config = newConfig
|
||||
w.clientsMutex.Unlock()
|
||||
|
||||
// Always apply the current log level based on the latest config.
|
||||
// This ensures logrus reflects the desired level even if change detection misses.
|
||||
util.SetLogLevel(newConfig)
|
||||
// Additional debug for visibility when the flag actually changes.
|
||||
if oldConfig != nil && oldConfig.Debug != newConfig.Debug {
|
||||
log.Debugf("log level updated - debug mode changed from %t to %t", oldConfig.Debug, newConfig.Debug)
|
||||
}
|
||||
|
||||
// Log configuration changes in debug mode
|
||||
if oldConfig != nil {
|
||||
log.Debugf("config changes detected:")
|
||||
|
||||
Reference in New Issue
Block a user