优化日志系统
This commit is contained in:
@@ -5,7 +5,6 @@ import (
|
||||
"image"
|
||||
"image/color"
|
||||
"image/png"
|
||||
"log"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"time"
|
||||
@@ -71,13 +70,13 @@ func (s *appState) saveSuccessImage(account Account, product Product, roleName s
|
||||
path := filepath.Join(s.paths.SuccessDir, name)
|
||||
file, err := os.Create(path)
|
||||
if err != nil {
|
||||
log.Printf("成功图片创建失败: %v", err)
|
||||
logEvent("图片", "error", "成功图片创建失败: %v", err)
|
||||
return
|
||||
}
|
||||
defer file.Close()
|
||||
if err := png.Encode(file, img); err != nil {
|
||||
log.Printf("成功图片保存失败: %v", err)
|
||||
logEvent("图片", "error", "成功图片保存失败: %v", err)
|
||||
return
|
||||
}
|
||||
log.Printf("成功图片已保存: %s", path)
|
||||
logEvent("图片", "success", "成功图片已保存: %s", path)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user