mirror of
https://github.com/charlienet/go-mixed.git
synced 2025-07-17 16:12:42 +08:00
24 lines
389 B
Go
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)
|
|
}
|