log

package
v21.2.1 Latest Latest
Warning

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

Go to latest
Published: Jan 3, 2024 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Logger

type Logger interface {
	Info(msg string, fields ...zap.Field)
	Warn(msg string, fields ...zap.Field)
	Error(msg string, fields ...zap.Field)
	Debug(msg string, fields ...zap.Field)
}

func NewLogger

func NewLogger(isProduction bool, fileName string, logLevelStr string) (Logger, error)

NewLogger creates a new logger. If fileName is non-empty, it pipes logs to file and stdout. if filename is empty, it pipes logs only to stdout.

type NoOpLogger

type NoOpLogger struct{}

func (*NoOpLogger) Debug

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

Debug implements Logger.

func (*NoOpLogger) Error

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

Error implements Logger.

func (*NoOpLogger) Info

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

Info implements Logger.

func (*NoOpLogger) Warn

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

Warn implements Logger.

Jump to

Keyboard shortcuts

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