formatter

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Jul 19, 2024 License: ISC Imports: 7 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	TagTrace = color.Bold(color.Cyan("trace"))
	TagDebug = color.Bold(color.Blue("debug"))
	TagInfo  = color.Bold(color.Green(" info"))
	TagWarn  = color.Bold(color.Yellow(" warn"))
	TagError = color.Bold(color.Magenta("error"))
	TagFatal = color.Bold(color.Red("fatal"))
	TagPanic = color.Bold(color.Red("panic"))
)

Functions

func FormatGinRouter

func FormatGinRouter(log Log) string

func FormatGorm added in v0.0.2

func FormatGorm(log Log) string

func Formatter

func Formatter(log Log) string

func Groups added in v0.0.2

func Groups(groups []Group, prefix, mapKey string) *strings.Builder

func Level

func Level(level string) string

func Map

func Map(data Data, prefix, mapKey string, parseDepth int) *strings.Builder

func Pid

func Pid(pid int) string

func Time

func Time(ts time.Time) string

Types

type Data

type Data = map[string]any

type Group added in v0.0.2

type Group struct {
	Key   string
	Value Data
}

type Log

type Log interface {
	Name() string
	Level() string
	Time() time.Time
	Msg() string
	Pid() int
	Src() string
	Err() string
	Stack() string
	Groups() []Group
}

Jump to

Keyboard shortcuts

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