logutil

package
v1.6.6 Latest Latest
Warning

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

Go to latest
Published: Feb 1, 2022 License: Apache-2.0 Imports: 8 Imported by: 4

Documentation

Overview

Package logutil implements various log utilities.

Index

Constants

This section is empty.

Variables

View Source
var DefaultLogLevel = "info"

DefaultLogLevel is the default log level.

Functions

func AddOutputPaths

func AddOutputPaths(cfg zap.Config, outputPaths, errorOutputPaths []string) zap.Config

AddOutputPaths adds output paths to the existing output paths, resolving conflicts.

func ConvertToZapLevel

func ConvertToZapLevel(lvl string) zapcore.Level

ConvertToZapLevel converts log level string to zapcore.Level.

func GetDefaultZapLogger

func GetDefaultZapLogger() (*zap.Logger, error)

GetDefaultZapLogger returns a new default logger.

func GetDefaultZapLoggerConfig added in v1.0.4

func GetDefaultZapLoggerConfig() zap.Config

GetDefaultZapLoggerConfig returns a new default zap logger configuration.

func NewWithStderrWriter added in v1.4.6

func NewWithStderrWriter(logLevel string, logOutputs []string) (lg *zap.Logger, wr io.Writer, logFile *os.File, err error)

NewWithStderrWriter creates a new logger and multi-writer with os.Stderr. The returned file object is the log file. The log file must be specified with extension ".log".

Types

This section is empty.

Jump to

Keyboard shortcuts

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