zlog

package
v1.1.3 Latest Latest
Warning

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

Go to latest
Published: Jun 8, 2023 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package zlog provides logging services.

Index

Constants

This section is empty.

Variables

View Source
var Logger = initLogger() // Logger exposes the zap logger
View Source
var LoggerConfig zap.Config // LoggerConfig can be used to SetLevel: LoggerConfig.Level.SetLevel(zap.DebugLevel)

Functions

func CtxDebugf

func CtxDebugf(ctx context.Context, debug bool, format string, v ...any)

CtxDebugf logs at debug level with trace context and Printf-like formatting.

func CtxErrorf

func CtxErrorf(ctx context.Context, format string, v ...any)

CtxErrorf logs at error level with trace context and Printf-like formatting.

func CtxInfof

func CtxInfof(ctx context.Context, format string, v ...any)

CtxInfof logs at info level with trace context and Printf-like formatting.

func Debugf

func Debugf(debug bool, format string, v ...any)

Debugf logs at debug level with Printf-like formatting.

func Errorf

func Errorf(format string, v ...any)

Errorf logs at error level with Printf-like formatting.

func Fatalf

func Fatalf(format string, v ...any)

Fatalf logs at fatal level with Printf-like formatting, then exits.

func GinErrorf

func GinErrorf(c *gin.Context, format string, v ...any)

GinErrorf logs at error level with gin trace context and Printf-like formatting.

func GinInfof

func GinInfof(c *gin.Context, format string, v ...any)

GinInfof logs at info level with gin trace context and Printf-like formatting.

func GinzapFields

func GinzapFields(c *gin.Context) []zapcore.Field

GinzapFields provides fields for ginzap log middleware.

func Infof

func Infof(format string, v ...any)

Infof logs at info level with Printf-like formatting.

Types

This section is empty.

Jump to

Keyboard shortcuts

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