mirror of
https://github.com/router-for-me/CLIProxyAPI.git
synced 2026-02-02 20:40:52 +08:00
refactor(logging, mgmt): update timestamp format in logs and remove force-gpt-5-codex handlers
- Changed log timestamp format in `request_logger.go` to align with ISO standards for improved readability. - Removed deprecated `force-gpt-5-codex` handlers from management API.
This commit is contained in:
@@ -278,10 +278,6 @@ func (s *Server) setupRoutes() {
|
|||||||
mgmt.PUT("/debug", s.mgmt.PutDebug)
|
mgmt.PUT("/debug", s.mgmt.PutDebug)
|
||||||
mgmt.PATCH("/debug", s.mgmt.PutDebug)
|
mgmt.PATCH("/debug", s.mgmt.PutDebug)
|
||||||
|
|
||||||
mgmt.GET("/force-gpt-5-codex", s.mgmt.GetForceGPT5Codex)
|
|
||||||
mgmt.PUT("/force-gpt-5-codex", s.mgmt.PutForceGPT5Codex)
|
|
||||||
mgmt.PATCH("/force-gpt-5-codex", s.mgmt.PutForceGPT5Codex)
|
|
||||||
|
|
||||||
mgmt.GET("/proxy-url", s.mgmt.GetProxyURL)
|
mgmt.GET("/proxy-url", s.mgmt.GetProxyURL)
|
||||||
mgmt.PUT("/proxy-url", s.mgmt.PutProxyURL)
|
mgmt.PUT("/proxy-url", s.mgmt.PutProxyURL)
|
||||||
mgmt.PATCH("/proxy-url", s.mgmt.PutProxyURL)
|
mgmt.PATCH("/proxy-url", s.mgmt.PutProxyURL)
|
||||||
|
|||||||
@@ -268,9 +268,10 @@ func (l *FileRequestLogger) generateFilename(url string) string {
|
|||||||
sanitized := l.sanitizeForFilename(path)
|
sanitized := l.sanitizeForFilename(path)
|
||||||
|
|
||||||
// Add timestamp
|
// Add timestamp
|
||||||
timestamp := time.Now().UnixNano()
|
timestamp := time.Now().Format("2006-01-02T150405-.000000000")
|
||||||
|
timestamp = strings.Replace(timestamp, ".", "", -1)
|
||||||
|
|
||||||
return fmt.Sprintf("%s-%d.log", sanitized, timestamp)
|
return fmt.Sprintf("%s-%s.log", sanitized, timestamp)
|
||||||
}
|
}
|
||||||
|
|
||||||
// sanitizeForFilename replaces characters that are not safe for filenames.
|
// sanitizeForFilename replaces characters that are not safe for filenames.
|
||||||
|
|||||||
Reference in New Issue
Block a user