mirror of
https://github.com/shadow1ng/fscan.git
synced 2026-09-25 20:51:52 +08:00
refactor(logging): 统一日志前缀,删除废弃的 LogBase
- 删除 LogBase 函数,所有调用迁移到 LogInfo/LogError - 新增 PrefixDebug ([.]) 前缀,所有日志级别现在都有前缀 - 修复日志输出缩进不一致的问题 - 删除未使用的 PrefixDefault 常量
This commit is contained in:
+2
-2
@@ -85,7 +85,7 @@ func StartServer(port int) error {
|
||||
|
||||
go func() {
|
||||
<-quit
|
||||
common.LogBase(i18n.GetText("web_shutting_down"))
|
||||
common.LogInfo(i18n.GetText("web_shutting_down"))
|
||||
|
||||
ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second)
|
||||
defer cancel()
|
||||
@@ -98,7 +98,7 @@ func StartServer(port int) error {
|
||||
|
||||
// 启动服务器
|
||||
common.LogSuccess(i18n.Tr("web_server_started", port))
|
||||
common.LogBase(fmt.Sprintf("http://localhost:%d", port))
|
||||
fmt.Printf(" http://localhost:%d\n", port)
|
||||
|
||||
if err := server.ListenAndServe(); err != nil && err != http.ErrServerClosed {
|
||||
return fmt.Errorf("server error: %w", err)
|
||||
|
||||
Reference in New Issue
Block a user