123456789101112131415161718192021222324252627 |
- package TimeTask
- import (
- "PublishCode/logs"
- "fmt"
- "io/ioutil"
- "os"
- "time"
- )
- var OrmLogOrmLog *os.File
- func OrmLog_MonitorScanStatus() {
- logs.Println("------- ORM 日志清理 --------")
- Data, err := ioutil.ReadFile(OrmLogOrmLog.Name())
- if err != nil {
- fmt.Printf("文件打开失败=%v\n", err)
- return
- }
- err = ioutil.WriteFile("logs/orm/logx_"+time.Now().Format("2006-01-02")+".log", Data, 0666)
- if err != nil {
- fmt.Printf("文件打开失败=%v\n", err)
- }
- logs.Println("清空:", os.Truncate(OrmLogOrmLog.Name(), 0))
- }
|