log

package
v1.5.32 Latest Latest
Warning

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

Go to latest
Published: Nov 24, 2024 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	RecentLogs []*zapcore.Entry
)

Functions

func CreateTestLogger

func CreateTestLogger() (util.Logger, error)

func InitLogging

func InitLogging(debug bool, fns ...ListenerFunc) (util.Logger, error)

Types

type Color

type Color uint8
const (
	Black Color = iota + 30
	Red
	Green
	Yellow
	Blue
	Magenta
	Cyan
	White
)

func (Color) Add

func (c Color) Add(s string) string

type ListenerFunc added in v1.2.16

type ListenerFunc func(level string, occurred time.Time, loggerName string, message string, caller util.ValueMap, stack string, fields util.ValueMap)

type LogFn added in v1.4.5

type LogFn func(t *Timer, log string, elapsed int)

type Timer added in v0.2.20

type Timer struct {
	Key   string      `json:"key"`
	Laps  []int       `json:"laps,omitempty"`
	Logs  []string    `json:"logs,omitempty"`
	Log   util.Logger `json:"-"`
	Timer *util.Timer `json:"-"`
	// contains filtered or unexported fields
}

Timer lets you measure laps. It is not safe for concurrent use.

func NewTimer added in v0.2.20

func NewTimer(key string, persistLogs bool, logger util.Logger, fns ...LogFn) *Timer

func (*Timer) Complete added in v0.2.20

func (t *Timer) Complete() int

func (*Timer) Lap added in v0.2.20

func (t *Timer) Lap(msg string, args ...any) int

Jump to

Keyboard shortcuts

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