ulog

package
v0.1.57 Latest Latest
Warning

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

Go to latest
Published: Jan 18, 2023 License: MIT Imports: 15 Imported by: 10

Documentation

Index

Constants

View Source
const LevelDefault = LevelInfo

Variables

This section is empty.

Functions

func AppName

func AppName() string

func Close

func Close()

func Critical

func Critical(v ...any)

func Criticalf

func Criticalf(format string, v ...any)

func Debug

func Debug(v ...any)

func Debugf

func Debugf(format string, v ...any)

func Error

func Error(v ...any)

func Errorf

func Errorf(format string, v ...any)

func Format

func Format(level Level, v ...any) string

func GenFilename

func GenFilename(dir, app string) string

func Info

func Info(v ...any)

func Infof

func Infof(format string, v ...any)

func Init

func Init(opts Options)

func InitConsole

func InitConsole()

func InitDir

func InitDir(dirname string)

func InitFile

func InitFile(filename string)

func OpenFile

func OpenFile(filename string, append bool) *os.File

func Panicf

func Panicf(format string, v ...any)

func Print

func Print(level Level, v ...any)

func Printf

func Printf(level Level, format string, v ...any)

func Query added in v0.1.45

func Query(f Filter) (lines []string, err error)

func QueryFromFile added in v0.1.45

func QueryFromFile(filename string, f Filter) (ret []string, err error)

func Recover added in v0.1.50

func Recover()

func Stat

func Stat() string

func Trace added in v0.1.45

func Trace(v ...any)

func Tracef added in v0.1.45

func Tracef(format string, v ...any)

func Warning

func Warning(v ...any)

func Warningf

func Warningf(format string, v ...any)

Types

type Filter added in v0.1.45

type Filter struct {
	Level Level
	Last  int
}

type Level

type Level int
const (
	LevelTrace Level = iota + 1
	LevelDebug
	LevelInfo
	LevelWarning
	LevelError
	LevelCritical
)

func ParseLevel

func ParseLevel(s string) Level

func (Level) Laconic

func (l Level) Laconic() string

func (Level) String

func (l Level) String() string

type Log

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

func Empty added in v0.1.52

func Empty() *Log

func New added in v0.1.3

func New(prefix string) *Log

func (*Log) Branch added in v0.1.29

func (this *Log) Branch(prefix string) *Log

func (*Log) Close

func (this *Log) Close()

func (*Log) Critical

func (this *Log) Critical(v ...any)

func (*Log) Criticalf

func (this *Log) Criticalf(format string, v ...any)

func (*Log) Debug

func (this *Log) Debug(v ...any)

func (*Log) Debugf

func (this *Log) Debugf(format string, v ...any)

func (*Log) Enable added in v0.1.26

func (this *Log) Enable(enable bool) *Log

func (*Log) Error

func (this *Log) Error(v ...any)

func (*Log) Errorf

func (this *Log) Errorf(format string, v ...any)

func (*Log) Info

func (this *Log) Info(v ...any)

func (*Log) Infof

func (this *Log) Infof(format string, v ...any)

func (*Log) Init added in v0.1.45

func (this *Log) Init(opts Options) *Log

func (*Log) IsGloabl added in v0.1.45

func (this *Log) IsGloabl() bool

func (*Log) Print

func (this *Log) Print(level Level, v ...any)

func (*Log) Printf

func (this *Log) Printf(level Level, format string, v ...any)

func (*Log) Query added in v0.1.45

func (this *Log) Query(f Filter) (lines []string, err error)

func (*Log) Recover added in v0.1.50

func (this *Log) Recover()

func (*Log) Stat added in v0.1.45

func (this *Log) Stat()

func (*Log) Trace added in v0.1.47

func (this *Log) Trace(v ...any)

func (*Log) Tracef added in v0.1.47

func (this *Log) Tracef(format string, v ...any)

func (*Log) Warning

func (this *Log) Warning(v ...any)

func (*Log) Warningf

func (this *Log) Warningf(format string, v ...any)

func (*Log) WithID added in v0.1.4

func (this *Log) WithID(id any) *Log

func (*Log) WithLevel added in v0.1.26

func (this *Log) WithLevel(level Level) *Log

func (*Log) WithLifetime

func (this *Log) WithLifetime() *Log

func (*Log) WithLifetimeDebug

func (this *Log) WithLifetimeDebug() *Log

type Message

type Message struct {
	Time  string
	GoID  string
	Level string
	Text  string
	// contains filtered or unexported fields
}

func NewMessage

func NewMessage(level Level, v ...any) *Message

func (*Message) Format

func (this *Message) Format() string

func (*Message) Size added in v0.1.45

func (this *Message) Size() int

type Options added in v0.1.49

type Options struct {
	Level     any
	Console   bool
	File      string
	Dir       string
	Append    bool
	AppName   string
	GoID      bool
	CrtStdErr bool
	SplitArgs any
	// contains filtered or unexported fields
}

type Statistics

type Statistics struct {
	Size     uint
	Trace    uint
	Debug    uint
	Info     uint
	Warning  uint
	Error    uint
	Critical uint
}

func (*Statistics) Push

func (this *Statistics) Push(level Level, size int)

Jump to

Keyboard shortcuts

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