Documentation
¶
Overview ¶
Package log is a wraper for log
Package log is a logger wraper * * Author: CZ cz.theng@gmail.com
Index ¶
- Constants
- Variables
- func DEBUG(format string, v ...interface{}) error
- func ERROR(format string, v ...interface{}) error
- func FATAL(format string, v ...interface{}) error
- func INFO(format string, v ...interface{}) error
- func WARNING(format string, v ...interface{}) error
- type Level
- type Logger
- func (l *Logger) Debug(format string, v ...interface{}) error
- func (l *Logger) Error(format string, v ...interface{}) error
- func (l *Logger) Fatal(format string, v ...interface{}) error
- func (l *Logger) Info(format string, v ...interface{}) error
- func (l *Logger) SetCallDepth(d int)
- func (l *Logger) SetLevel(level Level)
- func (l *Logger) SetMaxFileSize(fileSize uint64)
- func (l *Logger) Warning(format string, v ...interface{}) error
Constants ¶
View Source
const ( //LNULL is none LNULL = iota //LDEBUG is debug log LDEBUG // LINFO is info log LINFO //LWARNING is warning log LWARNING //LERROR is error log LERROR //LFATAL is fatal log LFATAL )
Variables ¶
View Source
var ErrOutput = errors.New("Output is invalied!")
EOutput is output error
Functions ¶
Types ¶
type Level ¶
type Level int // loose enum type . maybe have some other define method
Level is log's level
type Logger ¶
type Logger struct {
// contains filtered or unexported fields
}
Logger is log object
func NewConsoleLogger ¶
NewConsoleLogger create a Console Logger
func NewFileLogger ¶
NewFileLogger create a file logger
func (*Logger) SetMaxFileSize ¶
SetMaxFileSize set max files size
Click to show internal directories.
Click to hide internal directories.