formatter

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Dec 4, 2025 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type JSONFormatter

type JSONFormatter struct{}

func NewJSONFormatter

func NewJSONFormatter() *JSONFormatter

func (*JSONFormatter) Format

func (f *JSONFormatter) Format(e scriba.Entry) ([]byte, error)

type MsgPackFormatter

type MsgPackFormatter struct{}

func NewMsgPackFormatter

func NewMsgPackFormatter() *MsgPackFormatter

func (*MsgPackFormatter) Format

func (f *MsgPackFormatter) Format(e scriba.Entry) ([]byte, error)

type PrettyFormatter

type PrettyFormatter struct {
	TimeFormat    string
	Theme         *PrettyTheme
	DisableColors bool
}

func NewPrettyFormatter

func NewPrettyFormatter() *PrettyFormatter

func NewPrettyFormatterWithTheme

func NewPrettyFormatterWithTheme(theme *PrettyTheme) *PrettyFormatter

func (*PrettyFormatter) Format

func (f *PrettyFormatter) Format(e scriba.Entry) ([]byte, error)

type PrettyTheme

type PrettyTheme struct {
	Time       StyleFunc
	Level      StyleFunc
	Message    StyleFunc
	FieldKey   StyleFunc
	FieldValue StyleFunc
	Error      StyleFunc
	ResetAll   func() string // usado se o sistema de cor precisar reset manual
}

PrettyTheme define como estilizar cada parte do log.

func NoColorTheme

func NoColorTheme() *PrettyTheme

NoColorTheme é um tema que não aplica nenhuma cor/estilo.

func TICDefaultTheme

func TICDefaultTheme() *PrettyTheme

type StyleFunc

type StyleFunc func(string) string

StyleFunc aplica estilo/cor em uma string.

Jump to

Keyboard shortcuts

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