log

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Aug 17, 2024 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Int

func Int(key string, value int) zap.Field

Int creates a zap.Field with a map having an int value.

func PrettyPrint

func PrettyPrint(i interface{})

PrettyPrint prints any struct in a human-readable format.

func Str

func Str(key, value string) zap.Field

Str creates a zap.Field with a map having a string value.

Types

type Logger

type Logger struct {
	// contains filtered or unexported fields
}

Logger is a structured logger for the API.

func NewLogger

func NewLogger(env string) (Logger, error)

NewLogger instantiates a new testing, development or production Logger.

func (*Logger) Error

func (l *Logger) Error(err error, props ...zap.Field)

Error logs an error message.

func (*Logger) Fatal

func (l *Logger) Fatal(err error, props ...zap.Field)

Fatal logs a fatal error message.

func (*Logger) Info

func (l *Logger) Info(msg string, props ...zap.Field)

Info logs an informational message.

func (*Logger) ReportEnvs

func (l *Logger) ReportEnvs()

ReportEnvs reports source for environment variables

Jump to

Keyboard shortcuts

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