ulog

package
v0.1.8 Latest Latest
Warning

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

Go to latest
Published: Sep 3, 2022 License: MIT Imports: 13 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(conf Conf)

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 Stat

func Stat() string

func Warning

func Warning(v ...any)

func Warningf

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

Types

type Conf

type Conf struct {
	Level     any
	Console   bool
	File      string
	Dir       string
	Append    bool
	SplitArgs any
	// contains filtered or unexported fields
}

type Level

type Level int
const (
	LevelDebug Level = iota + 1
	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 New added in v0.1.3

func New(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) 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) Print

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

func (*Log) Printf

func (this *Log) Printf(level Level, 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) 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

type Statistics

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

func (*Statistics) Push

func (this *Statistics) Push(level Level)

Jump to

Keyboard shortcuts

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