logger

package
v0.0.0-...-ecab65a Latest Latest
Warning

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

Go to latest
Published: Jun 2, 2020 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Module = fx.Provide(New)

Module is the logger module that can be passed into an Fx app.

Functions

func Debug

func Debug(message string, fields ...interface{})

Debug logs a debug message with the given fields

func Error

func Error(message string, fields ...interface{})

Error logs a debug message with the given fields

func Fatal

func Fatal(message string, fields ...interface{})

Fatal logs a message than calls os.Exit(1)

func GetLogger

func GetLogger() *zap.Logger

Get ordinary logger

func Info

func Info(message string, fields ...interface{})

Info logs a debug message with the given fields

func Init

func Init(logLevel string)

Init initializes a thread-safe singleton logger This would be called from a main method when the application starts up This function would ideally, take zap configuration, but is left out in favor of simplicity using the example logger.

func New

func New() (*zap.SugaredLogger, error)

New constructs a new logger.

func Warn

func Warn(message string, fields ...interface{})

Warn logs a debug message with the given fields

Types

type Params

type Params struct {
	fx.In

	LogLevel string
}

Params is the input parameter struct for the logger module.

Jump to

Keyboard shortcuts

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