logging

package
v2.2.0 Latest Latest
Warning

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

Go to latest
Published: Jun 5, 2026 License: Apache-2.0 Imports: 4 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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

String returns the string representation of the log level.

func (Level) Value

func (l Level) Value() int

Value returns the integer value of the log level.

type Mode

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

func NewMode(mode string) (Mode, error)

NewMode creates a new Mode from a string.

func (Mode) String

func (l Mode) String() string

String returns the string representation of the Mode.

Jump to

Keyboard shortcuts

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