zap

package
v0.75.8 Latest Latest
Warning

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

Go to latest
Published: Apr 3, 2024 License: AGPL-3.0 Imports: 8 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

View Source
var SupportedLogLevels = []string{
	zapcore.DebugLevel.String(),
	zapcore.InfoLevel.String(),
	zapcore.WarnLevel.String(),
	zapcore.ErrorLevel.String(),
}

Functions

func Build added in v0.60.0

func Build(cfg zap.Config) (*zap.Logger, error)

func BuildJSONFileLogger added in v0.60.0

func BuildJSONFileLogger(level, filePath string) (*zap.Logger, error)

func BuildStandardConsoleLogger added in v0.60.0

func BuildStandardConsoleLogger(level string) (*zap.Logger, error)

func BuildStandardJSONLogger added in v0.60.0

func BuildStandardJSONLogger(level string) (*zap.Logger, error)

func DefaultConfig added in v0.60.0

func DefaultConfig() zap.Config

func EnsureIsSupportedLogLevel added in v0.60.0

func EnsureIsSupportedLogLevel(level string) error

func IsSupportedLogLevel added in v0.60.0

func IsSupportedLogLevel(level string) bool

func Sync

func Sync(logger Logger) func()

func WithConsoleFormat added in v0.60.0

func WithConsoleFormat(cfg zap.Config) zap.Config

func WithFileOutput added in v0.60.0

func WithFileOutput(cfg zap.Config, filePath string) zap.Config

func WithFileOutputForDedicatedProcess added in v0.60.0

func WithFileOutputForDedicatedProcess(cfg zap.Config, dirPath string) zap.Config

func WithJSONFormat added in v0.60.0

func WithJSONFormat(cfg zap.Config) zap.Config

func WithLevel added in v0.60.0

func WithLevel(cfg zap.Config, level string) zap.Config

func WithStandardOutput added in v0.60.0

func WithStandardOutput(cfg zap.Config) zap.Config

Types

type Logger

type Logger interface {
	Sync() error
}

Jump to

Keyboard shortcuts

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