Documentation ¶
Index ¶
- Constants
- 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 FlushLogger()
- func Info(v ...interface{})
- func Infof(format string, v ...interface{})
- func SetLevel(level LogLevel)
- func SetLogPath(path string)
- func Warn(v ...interface{})
- func Warnf(format string, v ...interface{})
- type ConsoleWriter
- type DateType
- type DateWriter
- type HourWriter
- type LogLevel
- type LogWriter
- 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) Fatal(v ...interface{})
- func (l *Logger) Fatalf(format string, v ...interface{})
- func (l *Logger) Info(v ...interface{})
- func (l *Logger) Infof(format string, v ...interface{})
- func (l *Logger) IsConsoleWriter() bool
- func (l *Logger) SetConsole()
- func (l *Logger) SetDayRoller(logpath string, num int) error
- func (l *Logger) SetFileRoller(logpath string, num int, sizeMB int) error
- func (l *Logger) SetHourRoller(logpath string, num int) error
- func (l *Logger) SetLogName(name string)
- func (l *Logger) SetWriter(w LogWriter)
- func (l *Logger) Warn(v ...interface{})
- func (l *Logger) Warnf(format string, v ...interface{})
- type RollFileWriter
Constants ¶
View Source
const (
// 时间戳 - 毫秒
Timestamp = "2006-01-02T15:04:05.000"
)
日志默认以天为单位
Variables ¶
This section is empty.
Functions ¶
func FlushLogger ¶
func FlushLogger()
func SetLogPath ¶
func SetLogPath(path string)
Types ¶
type ConsoleWriter ¶
type ConsoleWriter struct { }
func (*ConsoleWriter) NeedPrefix ¶
func (w *ConsoleWriter) NeedPrefix() bool
func (*ConsoleWriter) Write ¶
func (w *ConsoleWriter) Write(v []byte)
type DateWriter ¶
type DateWriter struct {
// contains filtered or unexported fields
}
func NewDateWriter ¶
func NewDateWriter(logpath, name string, dateType DateType, num int) *DateWriter
func (*DateWriter) NeedPrefix ¶
func (w *DateWriter) NeedPrefix() bool
func (*DateWriter) Write ¶
func (w *DateWriter) Write(v []byte)
type HourWriter ¶
type HourWriter struct { }
type Logger ¶
type Logger struct {
// contains filtered or unexported fields
}
func (*Logger) IsConsoleWriter ¶
func (*Logger) SetConsole ¶
func (l *Logger) SetConsole()
func (*Logger) SetFileRoller ¶
func (*Logger) SetLogName ¶
type RollFileWriter ¶
type RollFileWriter struct {
// contains filtered or unexported fields
}
func NewRollFileWriter ¶
func NewRollFileWriter(logpath, name string, num, sizeMB int) *RollFileWriter
func (*RollFileWriter) NeedPrefix ¶
func (w *RollFileWriter) NeedPrefix() bool
func (*RollFileWriter) Write ¶
func (w *RollFileWriter) Write(v []byte)
Click to show internal directories.
Click to hide internal directories.