Skip to content

Commit 49e104a

Browse files
author
𝐘𝐨𝐬𝐞𝐛𝐲𝐭𝐞
authored
fix: replace logger with fmt.Printf for API Key operations to enhance console output
1 parent fb4db58 commit 49e104a

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

internal/master.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -400,7 +400,7 @@ func (m *Master) Run() {
400400
}
401401
m.instances.Store(apiKeyID, apiKey)
402402
m.saveState()
403-
m.logger.Info("API Key created: %v", apiKey.URL)
403+
fmt.Printf("%s \033[32mINFO\033[0m API Key created: %v\n", time.Now().Format("2006-01-02 15:04:05.000"), apiKey.URL)
404404
} else {
405405
// 从API Key实例加载别名和主控ID
406406
m.alias = apiKey.Alias
@@ -413,7 +413,7 @@ func (m *Master) Run() {
413413
}
414414
m.mid = apiKey.Config
415415

416-
m.logger.Info("API Key loaded: %v", apiKey.URL)
416+
fmt.Printf("%s \033[32mINFO\033[0m API Key loaded: %v\n", time.Now().Format("2006-01-02 15:04:05.000"), apiKey.URL)
417417
}
418418

419419
// 设置HTTP路由
@@ -1346,7 +1346,7 @@ func (m *Master) handlePutInstance(w http.ResponseWriter, r *http.Request, id st
13461346
func (m *Master) regenerateAPIKey(instance *Instance) {
13471347
instance.URL = generateAPIKey()
13481348
m.instances.Store(apiKeyID, instance)
1349-
m.logger.Info("API Key regenerated: %v", instance.URL)
1349+
fmt.Printf("%s \033[32mINFO\033[0m API Key regenerated: %v\n", time.Now().Format("2006-01-02 15:04:05.000"), instance.URL)
13501350
go m.saveState()
13511351
go m.shutdownSSEConnections()
13521352
}

0 commit comments

Comments
 (0)