Documentation ¶
Overview ¶
Package log implements various log utilities.
Index ¶
- Variables
- func AddOutputPaths(cfg zap.Config, outputPaths, errorOutputPaths []string) zap.Config
- func ConvertToZapLevel(lvl string) zapcore.Level
- func GetDefaultZapLogger() (*zap.Logger, error)
- func GetDefaultZapLoggerConfig() zap.Config
- func NewWithStderrWriter(logLevel string, logOutputs []string) (lg *zap.Logger, wr io.Writer, logFile *os.File, err error)
Constants ¶
This section is empty.
Variables ¶
View Source
var DefaultLogLevel = "info"
DefaultLogLevel is the default log level.
Functions ¶
func AddOutputPaths ¶
AddOutputPaths adds output paths to the existing output paths, resolving conflicts.
func ConvertToZapLevel ¶
ConvertToZapLevel converts log level string to zapcore.Level.
func GetDefaultZapLogger ¶
GetDefaultZapLogger returns a new default logger.
func GetDefaultZapLoggerConfig ¶
GetDefaultZapLoggerConfig returns a new default zap logger configuration.
func NewWithStderrWriter ¶
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". If the logOutputs is "stderr", it just returns the os.Stderr.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.