log

package
v0.3.18 Latest Latest
Warning

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

Go to latest
Published: Apr 20, 2024 License: MIT Imports: 6 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Debug

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

Debug logs error messages

func Error

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

Error logs error messages

func Fatal

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

Fatal logs error messages

func Info

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

Info logs error messages

func Panic

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

Panic logs error messages

func SetLevel

func SetLevel(level Level)

SetLevel calls SetLevel on the underlying logger

func SetWriteSyncer

func SetWriteSyncer(out io.Writer)

SetWriteSyncer sets the underlying logger

func Sync

func Sync()

Sync calls Sync on the underlying logger

func Warn

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

Warn logs error messages

Types

type Field

type Field = zap.Field

Field represents the key-value pair for logging

type Level

type Level = zapcore.Level

Level of logging

const (
	// DebugLevel logs are typically voluminous, and are usually disabled in
	// production.
	DebugLevel Level = zapcore.DebugLevel
	// InfoLevel is the default logging priority.
	InfoLevel Level = zapcore.InfoLevel
	// WarnLevel logs are more important than Info, but don't need individual
	// human review.
	WarnLevel Level = zapcore.WarnLevel
	// ErrorLevel logs are high-priority. If an application is running smoothly,
	// it shouldn't generate any error-level logs.
	ErrorLevel Level = zapcore.ErrorLevel
	// DPanicLevel logs are particularly important errors. In development the
	// logger panics after writing the message.
	DPanicLevel Level = zapcore.DPanicLevel
	// PanicLevel logs a message, then panics.
	PanicLevel Level = zapcore.PanicLevel
	// FatalLevel logs a message, then calls os.Exit(1).
	FatalLevel Level = zapcore.FatalLevel
)

func GetLevel

func GetLevel() Level

type WriteSyncer

type WriteSyncer = zapcore.WriteSyncer

WriteSyncer represents a writer than support syncing.

Jump to

Keyboard shortcuts

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