1
0
mirror of https://github.com/charlienet/go-mixed.git synced 2025-07-18 00:22:41 +08:00
Files
go-mixed/logx/log_writer.go
2022-07-29 09:46:29 +08:00

24 lines
389 B
Go

package logx
import (
"io"
"os"
)
type Rotate int
const (
None Rotate = iota // 不分割日志
Size // 按大小分割
Date // 按日期分割
)
type OutputOptions struct {
LogrusOutputOptions
}
func WithFile(filename string) (io.Writer, error) {
mode := os.FileMode(0644)
return os.OpenFile(filename, os.O_CREATE|os.O_WRONLY|os.O_APPEND, mode)
}