glog

package
v0.0.0-...-f3abbe6 Latest Latest
Warning

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

Go to latest
Published: Sep 27, 2020 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultLogger = &Logz{}

Functions

func AssertOk

func AssertOk(err error, wrapMsg ...string)

func AssertTrue

func AssertTrue(express bool, wrapMsg ...string)

func Debgf

func Debgf(format string, a ...interface{})

func Erro

func Erro(err error, wrapMsg ...string)

func Errof

func Errof(format string, a ...interface{})

func Fata

func Fata(err error, wrapMsg ...string)

func Fataf

func Fataf(format string, a ...interface{})

func Infof

func Infof(format string, a ...interface{})

func Init

func Init(saveDisk bool)

func SetClock

func SetClock(c gtime.Clock)

func Warnf

func Warnf(format string, a ...interface{})

Types

type Config

type Config struct {
	SaveDisk       bool
	SaveDir        string
	FileNameFormat string
	PrintScreen    bool

	MachId  string
	AppName string
}

func DefaultConfig

func DefaultConfig() (*Config, error)

type Logz

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

func NewLogz

func NewLogz(c gtime.Clock) *Logz

func (*Logz) AssertOk

func (lgz *Logz) AssertOk(err error, wrapMsg ...string)

func (*Logz) AssertTrue

func (lgz *Logz) AssertTrue(express bool, wrapMsg ...string)

func (*Logz) Debgf

func (lgz *Logz) Debgf(format string, a ...interface{})

func (*Logz) Destroy

func (lgz *Logz) Destroy()

func (*Logz) Erro

func (lgz *Logz) Erro(err error, wrapMsg ...string)

func (*Logz) Errof

func (lgz *Logz) Errof(format string, a ...interface{})

func (*Logz) Fata

func (lgz *Logz) Fata(err error, wrapMsg ...string)

func (*Logz) Fataf

func (lgz *Logz) Fataf(format string, a ...interface{})

func (*Logz) Flush

func (lgz *Logz) Flush()

func (*Logz) Infof

func (lgz *Logz) Infof(format string, a ...interface{})

func (*Logz) Init

func (lgz *Logz) Init(config *Config) error

注意,这里的receiver必须用*Logz,不可以用logger,否则conf将无法保存进l里面去

func (*Logz) Logging

func (lgz *Logz) Logging(log glogger.Log) error

func (*Logz) LoggingEx

func (lgz *Logz) LoggingEx(level glogger.Level, text string, tags map[string]string) error

func (*Logz) SetClock

func (lgz *Logz) SetClock(c gtime.Clock)

func (*Logz) Warnf

func (lgz *Logz) Warnf(format string, a ...interface{})

func (*Logz) WriteMsg

func (lgz *Logz) WriteMsg(when time.Time, msg string, level glogger.Level) error

Output to disk and screen if user want it

Jump to

Keyboard shortcuts

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