Documentation ¶
Index ¶
- func GetInfo(skip int) (funcName, fileName string, LineNum int)
- type ConsolLogger
- type FileLogger
- func (f *FileLogger) CheckSize(file *os.File) bool
- func (f *FileLogger) CloseLogFile() error
- func (f *FileLogger) Debug(format string, a ...interface{})
- func (f *FileLogger) Error(format string, a ...interface{})
- func (f *FileLogger) Info(format string, a ...interface{})
- func (f *FileLogger) Warn(format string, a ...interface{})
- type LogLevel
- type Logger
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type ConsolLogger ¶
type ConsolLogger struct {
// contains filtered or unexported fields
}
日志结构体
func (ConsolLogger) Error ¶
func (c ConsolLogger) Error(format string, a ...interface{})
func (ConsolLogger) Info ¶
func (c ConsolLogger) Info(format string, a ...interface{})
func (ConsolLogger) Warn ¶
func (c ConsolLogger) Warn(format string, a ...interface{})
type FileLogger ¶
type FileLogger struct { LogLevel LogLevel LogFileName string LogFilePath string FileOBJ *os.File ErrorFileOBJ *os.File LogMaxFileSize int64 }
FileLogger日志文件结构体
func NewFileLogger ¶
func NewFileLogger(levelStr, fileName, filePath string, maxFileSize int64) (*FileLogger, error)
FileLogger构造函数返回结构体指针*FileLogger levelStr:UNKNOWN、DEBUG、INFO、WARN、ERROR filePath:日志文件路径 maxFileSize:最大文件大小,单位字节(B)
func (*FileLogger) Error ¶
func (f *FileLogger) Error(format string, a ...interface{})
func (*FileLogger) Info ¶
func (f *FileLogger) Info(format string, a ...interface{})
func (*FileLogger) Warn ¶
func (f *FileLogger) Warn(format string, a ...interface{})
Click to show internal directories.
Click to hide internal directories.