log

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Mar 15, 2023 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ChangeConfig

func ChangeConfig(override func(*zap.Config))

ChangeConfig allows to override default zap logger config from init function

func Debug

func Debug(ctx context.Context, msg string, keyVal ...any)

Debug logs should be used in development environment only

func Error

func Error(ctx context.Context, msg string, keyVal ...any)

Error used to handle exceptional case. You can use `Error(ctx, "some msg", err)` as shorthand for `Error(ctx, "some msg", "error", err)“

func Fatal

func Fatal(ctx context.Context, msg string, keyVal ...any)

Fatal will print log to stdout and then os.Exit(1) will be called

func Info

func Info(ctx context.Context, msg string, keyVal ...any)

Info show essential events in program

func Panic

func Panic(ctx context.Context, msg string, keyVal ...any)

Panic is Fatal replacement for cases, when you need to evaluate defer before exit

func Print

func Print(vals ...any)

Print is very simple func that works like log.Print but create json and add " " separator to values *should be used for temprorary debug only

func SetLevel

func SetLevel(name string)

SetLevel will parse and set "debug/info/error" levels. Any case accepted

func With

func With(ctx context.Context, keyVal ...any) context.Context

With will add any number of key and value pairs to context, any follow log with ctx will inherit

Types

This section is empty.

Jump to

Keyboard shortcuts

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