logging

package
v1.6.1 Latest Latest
Warning

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

Go to latest
Published: May 22, 2025 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SetupLogEncoder

func SetupLogEncoder(loggingMode Mode, options *zap.Options) *zap.Options

SetupLogEncoder sets additional logger configuration options when development mode is enabled. In this way, the log structure is lighter and more human-friendly when the development mode is enabled.

Types

type Level

type Level int

Level represents the log level.

const (
	// InfoLevel is the default log level.
	InfoLevel Level = 0
	// DebugLevel is the debug log level.
	DebugLevel Level = 1
	// TraceLevel is the trace log level.
	TraceLevel Level = 2
)

func (Level) String

func (l Level) String() string

func (Level) Value

func (l Level) Value() int

Value returns the integer value of the log level.

type Mode added in v1.6.0

type Mode string

Mode is the type for the logging mode.

const (
	// DevelopmentMode is the development logging mode.
	DevelopmentMode Mode = "development"
	// ProductionMode is the production logging mode.
	ProductionMode Mode = "production"
)

func NewMode added in v1.6.0

func NewMode(mode string) (Mode, error)

NewMode creates a new Mode from a string.

func (Mode) String added in v1.6.0

func (l Mode) String() string

Jump to

Keyboard shortcuts

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