log

package
v0.5.4 Latest Latest
Warning

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

Go to latest
Published: Mar 19, 2022 License: MIT Imports: 9 Imported by: 10

Documentation

Index

Constants

View Source
const (
	INFO  = "info"
	WARN  = "warn"
	ERROR = "error"
	DEBUG = "debug"
	COST  = "cost"
	SHOW  = "show"
	STACK = 3
)

Variables

View Source
var LogDisable = true

Functions

func Cost

func Cost(arg ...interface{}) func(...func() []interface{})

func Debug

func Debug(arg ...interface{})

func Error

func Error(arg ...interface{})

func FileLine

func FileLine(h interface{}, n int) string

func FmtDuration

func FmtDuration(d time.Duration) string

func FmtInt

func FmtInt(i int) string

func FmtSize

func FmtSize(i uint64) string

func FmtTime

func FmtTime(t time.Time) string

func Info

func Info(arg ...interface{})

func Init

func Init(conf *conf.Conf)

func Now

func Now() time.Time

func NowStamp

func NowStamp() int64

func Show

func Show(arg ...interface{})

func Warn

func Warn(arg ...interface{})

Types

type Log

type Log struct {
	Filter   []string
	Prefix   []string
	Notice   []string
	Out, Err *os.File

	Output string

	*conf.Conf
	// contains filtered or unexported fields
}

func Open

func Open(conf *conf.Conf) (*Log, error)

func (*Log) Cost

func (log *Log) Cost(arg ...interface{}) func(...func() []interface{})

func (*Log) Debug

func (log *Log) Debug(arg ...interface{}) bool

func (*Log) Debugf

func (log *Log) Debugf(str string, arg ...interface{}) bool

func (*Log) Error

func (log *Log) Error(arg ...interface{})

func (*Log) Errorf

func (log *Log) Errorf(str string, arg ...interface{})

func (*Log) Info

func (log *Log) Info(arg ...interface{})

func (*Log) Infof

func (log *Log) Infof(str string, arg ...interface{})

func (*Log) Show

func (log *Log) Show(arg ...interface{})

func (*Log) Warn

func (log *Log) Warn(arg ...interface{})

func (*Log) Warnf

func (log *Log) Warnf(str string, arg ...interface{})

Jump to

Keyboard shortcuts

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