log

package
v0.0.0-...-c3afde3 Latest Latest
Warning

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

Go to latest
Published: Jul 6, 2023 License: BSD-3-Clause Imports: 4 Imported by: 4

Documentation

Overview

Package log provides log functionality. It wraps zap.Logger with trace.

Index

Constants

View Source
const (
	// EnvDevelopment is set to development.
	EnvDevelopment = "development"
	// EnvProduction is set to production.
	EnvProduction = "production"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Logger

type Logger struct {
	*zap.SugaredLogger
}

Logger provides logging functionality.

func NewLogger

func NewLogger(env string) *Logger

NewLogger creates an instance of Logger.

func (*Logger) Debugf

func (l *Logger) Debugf(ctx context.Context, template string, args ...interface{})

Debugf adds `trace_id` from context to the log.

func (*Logger) Errorf

func (l *Logger) Errorf(ctx context.Context, template string, args ...interface{})

Errorf adds `trace_id` from context to the log.

func (*Logger) Infof

func (l *Logger) Infof(ctx context.Context, template string, args ...interface{})

Infof adds `trace_id` from context to the log.

func (*Logger) Warnf

func (l *Logger) Warnf(ctx context.Context, template string, args ...interface{})

Warnf adds `trace_id` from context to the log.

Jump to

Keyboard shortcuts

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