Documentation
¶
Overview ¶
@Description: TODO
@Description: 对log file 进行维护: 1,在每天0点分割前天的日志为单独的文件,并以日期+.log为文件名后缀,然后删除两个月以前的日志文件。 2,每月1日0点30分,对上个月的日志文件以tar.gz进行打包压缩。
Index ¶
- Variables
- func CheckNotExist(src string) bool
- func CheckPermission(src string) bool
- func Debug(v ...interface{})
- func Debugf(format string, v ...interface{})
- func Error(v ...interface{})
- func Errorf(format string, v ...interface{})
- func Fatal(v ...interface{})
- func Fatalf(format string, v ...interface{})
- func GetExt(fileName string) string
- func GetSize(f multipart.File) (int, error)
- func Info(v ...interface{})
- func Infof(format string, v ...interface{})
- func IsNotExistMkDir(src string) error
- func Maintain()
- func MkDir(src string) error
- func MustOpen(fileName, filePath string) (*os.File, error)
- func Open(name string, flag int, perm os.FileMode) (*os.File, error)
- func Setup(filePath, fileName string)
- func Warn(v ...interface{})
- func Warnf(format string, v ...interface{})
- type Level
- type Logger
Constants ¶
This section is empty.
Variables ¶
View Source
var ( L Logger DefaultPrefix = "" DefaultCallerDepth = 2 LogRootPath = "runtime/" TimeFormat = "2006-01-02" LogFileExt = "log" //每日0点0分重命名前一天的日志文件 CronEveryday = "0 0 0 * * ?" //每月一日0点30分执行压缩打包 CronEveryMonth = "0 30 0 1 * ?" )
Functions ¶
func CheckNotExist ¶
func CheckPermission ¶
func IsNotExistMkDir ¶
Types ¶
Click to show internal directories.
Click to hide internal directories.