glog

package module
v2.0.0+incompatible Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 21, 2017 License: Apache-2.0 Imports: 7 Imported by: 3 modules, 2 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

glog

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultOption = &Option{
	NumCache: 20,
	NumStack: 99,
	Level:    LEVELALL,
}

Functions

func Close

func Close()

func GenID

func GenID() string

Types

type Event

type Event struct {
	Level    Level
	Message  string
	Time     time.Time
	Data     interface{}
	FuncCall *FuncCall
}

type Field

type Field struct {
	// contains filtered or unexported fields
}

func (Field) Debug

func (self Field) Debug(args ...interface{})

func (Field) Debugf

func (self Field) Debugf(format string, args ...interface{})

func (Field) Debugln

func (self Field) Debugln(args ...interface{})

func (Field) Error

func (self Field) Error(args ...interface{})

func (Field) Errorf

func (self Field) Errorf(format string, args ...interface{})

func (Field) Errorln

func (self Field) Errorln(args ...interface{})

func (Field) G

func (self Field) G(k string) (interface{}, bool)

func (Field) Info

func (self Field) Info(args ...interface{})

func (Field) Infof

func (self Field) Infof(format string, args ...interface{})

func (Field) Infoln

func (self Field) Infoln(args ...interface{})

func (Field) Panic

func (self Field) Panic(args ...interface{})

func (Field) Panicf

func (self Field) Panicf(format string, args ...interface{})

func (Field) Panicln

func (self Field) Panicln(args ...interface{})

func (Field) S

func (self Field) S(k string, v interface{}) Field

func (Field) String

func (self Field) String() string

func (Field) Warn

func (self Field) Warn(args ...interface{})

func (Field) Warnf

func (self Field) Warnf(format string, args ...interface{})

func (Field) Warnln

func (self Field) Warnln(args ...interface{})

type FuncCall

type FuncCall struct {
	File string
	Line int
	Func string
}

func (FuncCall) String

func (fc FuncCall) String() string

type Level

type Level uint8
const (
	LEVELUNKNOWN Level = 0
	LEVELPANIC   Level = 1 << iota
	LEVELERROR
	LEVELWARN
	LEVELINFO
	LEVELDEBUG
	LEVELALL Level = LEVELPANIC | LEVELERROR | LEVELWARN | LEVELINFO | LEVELDEBUG
)

func (Level) String

func (level Level) String() string

type Listener

type Listener interface {
	ID() string
	Notify() chan Event
	Start()
	Pause(bool)
	Stop()
	Option() Option
}

type Logger

type Logger struct {
	// contains filtered or unexported fields
}

func New

func New() *Logger

func NewWithOption

func NewWithOption(o *Option) *Logger

func (*Logger) AddListener

func (logger *Logger) AddListener(l ...Listener)

func (*Logger) Close

func (logger *Logger) Close()

func (*Logger) Debug

func (logger *Logger) Debug(args ...interface{})

func (*Logger) Debugf

func (logger *Logger) Debugf(format string, args ...interface{})

func (*Logger) Debugln

func (logger *Logger) Debugln(args ...interface{})

func (*Logger) Error

func (logger *Logger) Error(args ...interface{})

func (*Logger) Errorf

func (logger *Logger) Errorf(format string, args ...interface{})

func (*Logger) Errorln

func (logger *Logger) Errorln(args ...interface{})

func (*Logger) Event

func (logger *Logger) Event(e Event)

func (*Logger) Go

func (logger *Logger) Go(f interface{}, params ...interface{})

func (*Logger) Info

func (logger *Logger) Info(args ...interface{})

func (*Logger) Infof

func (logger *Logger) Infof(format string, args ...interface{})

func (*Logger) Infoln

func (logger *Logger) Infoln(args ...interface{})

func (*Logger) NewField

func (logger *Logger) NewField() Field

func (*Logger) Option

func (logger *Logger) Option() *Option

func (*Logger) Panic

func (logger *Logger) Panic(args ...interface{})

func (*Logger) Panicf

func (logger *Logger) Panicf(format string, args ...interface{})

func (*Logger) Panicln

func (logger *Logger) Panicln(args ...interface{})

func (*Logger) Pause

func (logger *Logger) Pause(b bool)

func (*Logger) S

func (logger *Logger) S(k string, v interface{}) Field

func (*Logger) UpdateListener

func (logger *Logger) UpdateListener(l ...Listener)

func (*Logger) Warn

func (logger *Logger) Warn(args ...interface{})

func (*Logger) Warnf

func (logger *Logger) Warnf(format string, args ...interface{})

func (*Logger) Warnln

func (logger *Logger) Warnln(args ...interface{})

type Option

type Option struct {
	NumCache int
	NumStack int
	Fc       bool
	Level    Level
}

Directories

Path Synopsis
udp

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
⌂ 换网址