log

package
v0.0.0-...-3b26d93 Latest Latest
Warning

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

Go to latest
Published: Apr 5, 2024 License: Apache-2.0 Imports: 4 Imported by: 5

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Debugf

func Debugf(msg string, args ...any)

Errorf logs a debug msg using global logger

func Errorf

func Errorf(msg string, args ...any)

Errorf logs an error msg using global logger

func Fatalf

func Fatalf(msg string, args ...any)

Fatalf logs a fatal msg using global logger

func Infof

func Infof(msg string, args ...any)

Infof logs an info msg using global logger

func Init

func Init(name string)

Initialize logger for the given service name This is the contract for initializing logger. The actual implementation of the logger may vary based on runtime environment

func InitZapLogger

func InitZapLogger(name string)

InitZapLogger initializes a zap based logger and sets it as the default logger using SetGlobal

func SetGlobal

func SetGlobal(logger Logger)

SetGlobal sets the global logger instance

func Warnf

func Warnf(msg string, args ...any)

Warnf logs a warning msg using global logger

Types

type Logger

type Logger interface {
	Infof(msg string, args ...any)
	Warnf(msg string, args ...any)
	Errorf(msg string, args ...any)
	Debugf(msg string, args ...any)
	Fatalf(msg string, args ...any)

	With(args map[string]any) Logger
}

Logger represents a contract for implementing a logging module

func NewNopLogger

func NewNopLogger() Logger

NewNopLogger creates a No Operation (NOP) logger

func With

func With(args map[string]any) Logger

With returns a logger instance with args attributes

Jump to

Keyboard shortcuts

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