refactor: replace logger usage with common.Log for consistent logging

This commit is contained in:
krau
2025-03-21 21:07:53 +08:00
parent 65fee89e14
commit ed0837a89b
27 changed files with 152 additions and 158 deletions
+2 -4
View File
@@ -5,8 +5,6 @@ import (
"os"
"path/filepath"
"time"
"github.com/krau/SaveAny-Bot/logger"
)
// 创建文件, 自动创建目录
@@ -31,10 +29,10 @@ func PurgeFile(path string) error {
func RmFileAfter(path string, td time.Duration) {
_, err := os.Stat(path)
if err != nil {
logger.L.Errorf("Failed to create timer for %s: %s", path, err)
Log.Errorf("Failed to create timer for %s: %s", path, err)
return
}
logger.L.Debugf("Remove file after %s: %s", td, path)
Log.Debugf("Remove file after %s: %s", td, path)
time.AfterFunc(td, func() {
PurgeFile(path)
})