log

package
v0.4.4 Latest Latest
Warning

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

Go to latest
Published: Nov 2, 2021 License: MIT Imports: 5 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ERR_MUST_POINTER       error = errors.New("parameter must be pointer")
	ERR_INVALID_TYPE       error = errors.New("parameter invalid type")
	ERR_NOT_FOUND          error = errors.New("data is not found")
	ERR_READ_BUFFER        error = errors.New("cannot read least data")
	ERR_MORE_BUFFER        error = errors.New("require more data")
	ERR_NO_SUPPORT         error = errors.New("this method is not suppored")
	ERR_INVALID_INDEX      error = errors.New("invalid index number")
	ERR_NO_INCLUDE_ROOT    error = errors.New("dosent include root buffer")
	ERR_INVLIAD_WRITE_SIZE error = errors.New("invalid written size")
)

Functions

func Log

func Log(l LogLevel, fn LogFn)

if no output , not eval args

Log(LOG_DEBUG, func() LogArgs { return F("test %d \n", 1) })

func Printf added in v0.1.2

func Printf(s string, v ...interface{}) func() LogArgs

func SetLogLevel

func SetLogLevel(l LogLevel)

Types

type LogArgs

type LogArgs struct {
	Fmt  string
	Infs []interface{}
}

func F

func F(s string, v ...interface{}) LogArgs

type LogFn

type LogFn func() LogArgs //(string, interface{}...)

type LogLevel

type LogLevel byte
const (
	LOG_ERROR LogLevel = iota
	LOG_WARN
	LOG_DEBUG
)
var CurrentLogLevel LogLevel

Jump to

Keyboard shortcuts

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