Documentation
¶
Index ¶
- func CheckSection(opt interface{}) bool
- func CleanupGlsDefaultKey(key interface{})
- func Debugf(format string, args ...interface{})
- func Debugln(args ...interface{})
- func DisableSection(opt interface{})
- func EnableSection(opt interface{})
- func Errorf(format string, args ...interface{})
- func Errorln(args ...interface{})
- func Fatalf(format string, args ...interface{})
- func Fatalln(args ...interface{})
- func FlushAll()
- func GetGlsDefaultKey() interface{}
- func Infof(format string, args ...interface{})
- func Infoln(args ...interface{})
- func Recordf(format string, args ...interface{})
- func Recordln(args ...interface{})
- func SetGlsDefaultKey(key interface{})
- func SetLog(l LogI)
- func Warningf(format string, args ...interface{})
- func Warningln(args ...interface{})
- type Buffer
- type BufferWrap
- type FakeLog
- func (this *FakeLog) Clone(opt *LogOption) (LogI, error)
- func (this *FakeLog) Debugf(format string, args ...interface{})
- func (this *FakeLog) Debugln(args ...interface{})
- func (this *FakeLog) Errorf(format string, args ...interface{})
- func (this *FakeLog) Errorln(args ...interface{})
- func (this *FakeLog) Fatalf(format string, args ...interface{})
- func (this *FakeLog) Fatalln(args ...interface{})
- func (this *FakeLog) Flush() error
- func (this *FakeLog) Infof(format string, args ...interface{})
- func (this *FakeLog) Infoln(args ...interface{})
- func (this *FakeLog) Recordf(format string, args ...interface{})
- func (this *FakeLog) Recordln(args ...interface{})
- func (this *FakeLog) Warningf(format string, args ...interface{})
- func (this *FakeLog) Warningln(args ...interface{})
- type FileLog
- func (this *FileLog) Clone(opt *LogOption) (LogI, error)
- func (this *FileLog) Debugf(format string, args ...interface{})
- func (this *FileLog) Debugln(args ...interface{})
- func (this *FileLog) Errorf(format string, args ...interface{})
- func (this *FileLog) Errorln(args ...interface{})
- func (this *FileLog) Fatalf(format string, args ...interface{})
- func (this *FileLog) Fatalln(args ...interface{})
- func (this *FileLog) Flush() error
- func (this *FileLog) Infof(format string, args ...interface{})
- func (this *FileLog) Infoln(args ...interface{})
- func (this *FileLog) Recordf(format string, args ...interface{})
- func (this *FileLog) Recordln(args ...interface{})
- func (this *FileLog) Warningf(format string, args ...interface{})
- func (this *FileLog) Warningln(args ...interface{})
- type Level
- type LogI
- type LogOption
- type Manager
- type RingBuf
- type StdLog
- func (this *StdLog) Clone(opt *LogOption) (LogI, error)
- func (this *StdLog) Debugf(format string, args ...interface{})
- func (this *StdLog) Debugln(args ...interface{})
- func (this *StdLog) Errorf(format string, args ...interface{})
- func (this *StdLog) Errorln(args ...interface{})
- func (this *StdLog) Fatalf(format string, args ...interface{})
- func (this *StdLog) Fatalln(args ...interface{})
- func (this *StdLog) Flush() error
- func (this *StdLog) Infof(format string, args ...interface{})
- func (this *StdLog) Infoln(args ...interface{})
- func (this *StdLog) Recordf(format string, args ...interface{})
- func (this *StdLog) Recordln(args ...interface{})
- func (this *StdLog) Warningf(format string, args ...interface{})
- func (this *StdLog) Warningln(args ...interface{})
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CheckSection ¶
func CheckSection(opt interface{}) bool
func CleanupGlsDefaultKey ¶
func CleanupGlsDefaultKey(key interface{})
func DisableSection ¶
func DisableSection(opt interface{})
func EnableSection ¶
func EnableSection(opt interface{})
func GetGlsDefaultKey ¶
func GetGlsDefaultKey() interface{}
func SetGlsDefaultKey ¶
func SetGlsDefaultKey(key interface{})
警告: 调用这个接口的地方, 一定要记得使用结束后调用Cleanup, 否则会内存泄漏
Types ¶
type BufferWrap ¶
type BufferWrap struct { *Buffer // contains filtered or unexported fields }
func NewBufferWrap ¶
func NewBufferWrap(base *Buffer) *BufferWrap
func (*BufferWrap) WriteString ¶
func (this *BufferWrap) WriteString(s string) (n int, err error)
type LogI ¶
type LogI interface { Clone(opt *LogOption) (LogI, error) Debugf(format string, args ...interface{}) Infof(format string, args ...interface{}) Warningf(format string, args ...interface{}) Errorf(format string, args ...interface{}) Fatalf(format string, args ...interface{}) Recordf(format string, args ...interface{}) Debugln(args ...interface{}) Infoln(args ...interface{}) Warningln(args ...interface{}) Errorln(args ...interface{}) Fatalln(args ...interface{}) Recordln(args ...interface{}) Flush() error }
---------------------------------------------------
func BindOption ¶
func MakeLogger ¶
type LogOption ¶
type LogOption struct { // log struct type LogCategory string // toggle of logger Ignore bool // output file name OutputFile string // log info format: "$Level $datetime-ms $gid $file:$line] " HeaderFormat string // rotate category: size / time / "" RotateCategory string // rotate parameter: bytes of one file / seconds RotateValue int64 // rotate suffix format of filename: .$pid.$day-$hour-$minute-$second.log RotateSuffixFormat string // extends fields Extends map[string]string // contains filtered or unexported fields }
func DefaultLogOption ¶
func DefaultLogOption() *LogOption
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
var LogMgr *Manager = NewManager((*LogI)(nil))
func NewManager ¶
func NewManager(handlerType interface{}) *Manager
type RingBuf ¶
type RingBuf struct {
// contains filtered or unexported fields
}
func NewRingBuf ¶
func (*RingBuf) GetWriter ¶
func (this *RingBuf) GetWriter() *BufferWrap
func (*RingBuf) NextReader ¶
func (*RingBuf) Put ¶
func (this *RingBuf) Put(bufw *BufferWrap)
Click to show internal directories.
Click to hide internal directories.