zap

package
v0.0.0-...-589da53 Latest Latest
Warning

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

Go to latest
Published: May 30, 2023 License: MIT Imports: 8 Imported by: 0

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

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

func BuildJSONFileLogger

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

func BuildStandardConsoleLogger

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

func BuildStandardJSONLogger

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

func DefaultConfig

func DefaultConfig() zap.Config

func EnsureIsSupportedLogLevel

func EnsureIsSupportedLogLevel(level string) error

func IsSupportedLogLevel

func IsSupportedLogLevel(level string) bool

func Sync

func Sync(logger Logger) func()

func WithConsoleFormat

func WithConsoleFormat(cfg zap.Config) zap.Config

func WithFileOutput

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

func WithFileOutputForDedicatedProcess

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

func WithJSONFormat

func WithJSONFormat(cfg zap.Config) zap.Config

func WithLevel

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

func WithStandardOutput

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