Documentation
¶
Overview ¶
like https://gitea.com/lunny/log but made some adjustments
Index ¶
- Constants
- Variables
- 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 Info(v ...interface{})
- func Infof(format string, v ...interface{})
- func Panic(v ...interface{})
- func Panicf(format string, v ...interface{})
- func Print(v ...interface{})
- func Printf(format string, v ...interface{})
- func Println(v ...interface{})
- func SetColors(cls []int)
- func SetFileFormat(t ByType, format string)
- func SetLevels(lvs []string)
- func SetOutPut(out io.Writer)
- func Warn(v ...interface{})
- func Warnf(format string, v ...interface{})
- type ByType
- type FileInfo
- type FileOptions
- type Files
- type Logger
- func (l *Logger) Debug(v ...interface{})
- func (l *Logger) Debugf(format string, v ...interface{})
- func (l *Logger) Error(v ...interface{})
- func (l *Logger) Errorf(format string, v ...interface{})
- func (l *Logger) Info(v ...interface{})
- func (l *Logger) Infof(format string, v ...interface{})
- func (l *Logger) Panic(v ...interface{})
- func (l *Logger) Panicf(format string, v ...interface{})
- func (l *Logger) Print(v ...interface{})
- func (l *Logger) Printf(format string, v ...interface{})
- func (l *Logger) Println(v ...interface{})
- func (l *Logger) SetOutPut(out io.Writer)
- func (l *Logger) Warn(v ...interface{})
- func (l *Logger) Warnf(format string, v ...interface{})
Constants ¶
View Source
const ( Ldebug = iota Linfo Lwarn Lerror Lpanic Lfatal Lnone )
View Source
const ( ForeBlack = iota + 30 //30 ForeRed //31 ForeGreen //32 ForeYellow //33 ForeBlue //34 ForePurple //35 ForeCyan //36 ForeWhite //37 )
View Source
const ( BackBlack = iota + 40 //40 BackRed //41 BackGreen //42 BackYellow //43 BackBlue //44 BackPurple //45 BackCyan //46 BackWhite //47 )
View Source
const (
Lall = iota
)
Variables ¶
View Source
var (
Std = New(os.Stdout, "", logDefaultLevel())
)
Functions ¶
Types ¶
type FileOptions ¶
type FileOptions struct {
Dir string //日志目录
ByType ByType //按天/小时/月?
Loc *time.Location //时间
MaxDay int //最大留存天数
}
FileOptions 写文件选项
type Files ¶
type Files struct {
FileOptions
// contains filtered or unexported fields
}
func NewFileWriter ¶
func NewFileWriter(opts ...FileOptions) *Files
NewFileWriter 设置写文件参数
w:=logy.NewFileWriter(logy.FileOptions{
ByType:log.Day,
Dir:"./logs",
MaxDay:6,
})
logy.Std.SetOutPut(w)
Click to show internal directories.
Click to hide internal directories.