log

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Jan 4, 2024 License: AGPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ContextWithLogger

func ContextWithLogger(ctx context.Context, logger *zap.Logger) context.Context

func Default

func Default() *zap.Logger

func FromContext

func FromContext(ctx context.Context) *zap.Logger

func GetLogger

func GetLogger(c *gin.Context) *zap.SugaredLogger

func Init

func Init(opts ...Option) *zap.Logger

func New

func New(opts ...Option) *zap.Logger

func WithRequestID

func WithRequestID(requestID string) *zap.Logger

Types

type Option

type Option func(*option)

func AddCallerSkip

func AddCallerSkip(skip int) Option

AddCallerSkip adds the given number of callers skipped to the options.

func DisableConsole

func DisableConsole() Option

DisableConsole disables logging to console.

func WithErrorStacktrace

func WithErrorStacktrace(on bool) Option

WithErrorStacktrace sets whether to record stacktraces on errors.

func WithFilename

func WithFilename(filename string) Option

WithFilename sets the log filename.

func WithLevel

func WithLevel(level zapcore.Level) Option

WithLevel sets the log level.

Jump to

Keyboard shortcuts

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