Documentation ¶
Index ¶
- Variables
- func Close()
- func Debug(v ...interface{})
- func Error(v ...interface{})
- func Fatal(v ...interface{})
- func Fatalf(format string, v ...interface{})
- func Fatalln(v ...interface{})
- func Info(v ...interface{})
- func InitAppLogger()
- func Panic(v ...interface{})
- func Panicf(format string, v ...interface{})
- func Panicln(v ...interface{})
- func Print(v ...interface{})
- func Printf(format string, v ...interface{})
- func Println(v ...interface{})
- func SetFlags(flag int)
- func SetHandlers(handlers ...Handler)
- func SetLevel(level Level)
- func ToStackError(err error) string
- func Warn(v ...interface{})
- type ConsoleHander
- type FileHandler
- type Handler
- type Level
- type LogHandler
- func (l *LogHandler) Debug(v ...interface{})
- func (l *LogHandler) Error(v ...interface{})
- func (l *LogHandler) Fatal(v ...interface{})
- func (l *LogHandler) Fatalf(format string, v ...interface{})
- func (l *LogHandler) Fatalln(v ...interface{})
- func (l *LogHandler) Flags() int
- func (l *LogHandler) Info(v ...interface{})
- func (l *LogHandler) Output(calldepth int, s string) error
- func (l *LogHandler) Prefix() string
- func (l *LogHandler) Print(v ...interface{})
- func (l *LogHandler) Printf(format string, v ...interface{})
- func (l *LogHandler) Println(v ...interface{})
- func (l *LogHandler) SetFlags(flag int)
- func (l *LogHandler) SetOutput(w io.Writer)
- func (l *LogHandler) SetPrefix(prefix string)
- func (l *LogHandler) Warn(v ...interface{})
- type RotatingHandler
Constants ¶
This section is empty.
Variables ¶
View Source
var Console = NewConsoleHandler()
Functions ¶
func InitAppLogger ¶
func InitAppLogger()
func SetHandlers ¶
func SetHandlers(handlers ...Handler)
func ToStackError ¶
Types ¶
type ConsoleHander ¶
type ConsoleHander struct {
LogHandler
}
func NewConsoleHandler ¶
func NewConsoleHandler() *ConsoleHander
type FileHandler ¶
type FileHandler struct { LogHandler // contains filtered or unexported fields }
func NewFileHandler ¶
func NewFileHandler(filepath string) *FileHandler
type Handler ¶
type Handler interface { SetOutput(w io.Writer) Output(calldepth int, s string) error Printf(format string, v ...interface{}) Print(v ...interface{}) Println(v ...interface{}) Fatal(v ...interface{}) Fatalf(format string, v ...interface{}) Fatalln(v ...interface{}) Debug(v ...interface{}) Info(v ...interface{}) Warn(v ...interface{}) Error(v ...interface{}) Flags() int SetFlags(flag int) Prefix() string SetPrefix(prefix string) // contains filtered or unexported methods }
=================== log handlers ===================
type LogHandler ¶
type LogHandler struct {
// contains filtered or unexported fields
}
func (*LogHandler) Debug ¶
func (l *LogHandler) Debug(v ...interface{})
func (*LogHandler) Error ¶
func (l *LogHandler) Error(v ...interface{})
func (*LogHandler) Fatal ¶
func (l *LogHandler) Fatal(v ...interface{})
func (*LogHandler) Fatalf ¶
func (l *LogHandler) Fatalf(format string, v ...interface{})
func (*LogHandler) Fatalln ¶
func (l *LogHandler) Fatalln(v ...interface{})
func (*LogHandler) Flags ¶
func (l *LogHandler) Flags() int
func (*LogHandler) Info ¶
func (l *LogHandler) Info(v ...interface{})
func (*LogHandler) Prefix ¶
func (l *LogHandler) Prefix() string
func (*LogHandler) Print ¶
func (l *LogHandler) Print(v ...interface{})
func (*LogHandler) Printf ¶
func (l *LogHandler) Printf(format string, v ...interface{})
func (*LogHandler) Println ¶
func (l *LogHandler) Println(v ...interface{})
func (*LogHandler) SetFlags ¶
func (l *LogHandler) SetFlags(flag int)
func (*LogHandler) SetOutput ¶
func (l *LogHandler) SetOutput(w io.Writer)
func (*LogHandler) SetPrefix ¶
func (l *LogHandler) SetPrefix(prefix string)
func (*LogHandler) Warn ¶
func (l *LogHandler) Warn(v ...interface{})
type RotatingHandler ¶
type RotatingHandler struct { LogHandler // contains filtered or unexported fields }
func NewRotatingHandler ¶
func NewRotatingHandler(dir string, filename string, maxNum int, maxSize int64) *RotatingHandler
Click to show internal directories.
Click to hide internal directories.