logger

package
v0.22.4 Latest Latest
Warning

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

Go to latest
Published: Jul 19, 2022 License: AGPL-3.0, AGPL-3.0-only Imports: 10 Imported by: 0

Documentation

Overview

Package logger config a zap logger, functions have same signature with `zap.logger`. Can be configured by env `LOG_LEVEL`.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Copy

func Copy() *zap.Logger

func DPanic

func DPanic(msg string, fields ...zapcore.Field)

DPanic will panic in development and log error message at production env.

func Debug

func Debug(msg string, fields ...zapcore.Field)

Debug level logging.

func Err

func Err(err error, msg string, fields ...zapcore.Field)

Err log a error message with error.

func Error

func Error(msg string, fields ...zapcore.Field)

Error level logging.

func Fatal

func Fatal(msg string, fields ...zapcore.Field)

Fatal level message and call `os.Exit(1)`.

func FxLogger

func FxLogger() fx.Option

func Info

func Info(msg string, fields ...zapcore.Field)

Info level logging.

func Infoln

func Infoln(args ...any)

Infoln log as info level with fmt.Sprintln.

func Named

func Named(name string) *zap.Logger

Named create a named logger.

func Panic

func Panic(msg string, fields ...zapcore.Field)

Panic will log at panic level then panic.

func Std

func Std() *stdLog.Logger

Std return a stdlib logger with zap logger underlying.

func Warn

func Warn(msg string, fields ...zapcore.Field)

Warn level logging.

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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