tuipack

package
v1.6.1 Latest Latest
Warning

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

Go to latest
Published: Jan 22, 2025 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	EMPTY   = ""
	SPACE   = " "
	NEWLINE = "\n"
)

Variables

This section is empty.

Functions

func ParseLevel

func ParseLevel(n any) zerolog.Level

Types

type LogBot

type LogBot struct {
	Level   zerolog.Level
	Output  *LogOutput
	Logfile string
}

func (*LogBot) Blast

func (lb *LogBot) Blast(format string, a ...any)

Blast takes a string and passes it to LogBot.RouteLogMsg with zerolog.NoLevel. This ensures the message is logged regardless of the global log level.

func (*LogBot) BuildLogger

func (lb *LogBot) BuildLogger(lvl zerolog.Level) zerolog.Logger

func (*LogBot) Debug

func (lb *LogBot) Debug(format string, a ...any)

Debug takes a string and passes it to LogBot.RouteLogMsg with zerolog.DebugLevel.

func (*LogBot) Error

func (lb *LogBot) Error(format string, a ...any)

Error takes a string and passes it to LogBot.RouteLogMsg with zerolog.ErrorLevel.

func (*LogBot) Fatal

func (lb *LogBot) Fatal(format string, a ...any)

Fatal takes a string and passes it to LogBot.RouteLogMsg with zerolog.FatalLevel.

func (*LogBot) Info

func (lb *LogBot) Info(format string, a ...any)

Info takes a string and passes it to LogBot.RouteLogMsg with zerolog.InfoLevel.

func (*LogBot) Panic

func (lb *LogBot) Panic(format string, a ...any)

func (*LogBot) RouteLogMsg

func (lb *LogBot) RouteLogMsg(lvl zerolog.Level, msg string)

func (*LogBot) SetLogLevel

func (lb *LogBot) SetLogLevel(lvl zerolog.Level)

func (*LogBot) Warn

func (lb *LogBot) Warn(format string, a ...any)

Warn takes a string and passes it to LogBot.RouteLogMsg with zerolog.WarnLevel.

type LogMsg

type LogMsg struct {
	Level   zerolog.Level
	LogMsg  string
	ScrMsg  string
	ScrIcon string
}

func NewLogMsg

func NewLogMsg(scrMsg, scrIcon string, level zerolog.Level, logMsg string) *LogMsg

func NewLogMsgB

func NewLogMsgB() *LogMsg

func (*LogMsg) SetMsgUpload

func (lm *LogMsg) SetMsgUpload(name string) *LogMsg

type LogOutput

type LogOutput struct {
	Console bool
	File    bool
	Screen  bool
}

Jump to

Keyboard shortcuts

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