logger

package
Version: v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Dec 15, 2020 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// DebugLevel log level
	DebugLevel = zap.InfoLevel
	// InfoLevel log level
	InfoLevel = zap.InfoLevel
	// WarnLevel log level
	WarnLevel = zap.WarnLevel
	// ErrorLevel log level
	ErrorLevel = zap.ErrorLevel
	// FatalLevel log level
	FatalLevel = zap.FatalLevel
)

Variables

This section is empty.

Functions

func Debug

func Debug(msg string, tags ...zap.Field)

Debug function to log debug logs

func Error

func Error(msg string, tags ...zap.Field)

Error function to log error logs

func Fatal

func Fatal(msg string, tags ...zap.Field)

Fatal function to log fatal logs. This will exit the program.

func Field

func Field(key string, value interface{}) zap.Field

Field function for any custom key value pairs that needs to be logged

func Info

func Info(msg string, tags ...zap.Field)

Info function to log information logs

func Init

func Init(lc Config)

Init function that sets up the logging parameters for the application

func Warn

func Warn(msg string, tags ...zap.Field)

Warn function to log warning logs

Types

type Config

type Config struct {
	FileName   string
	MaxSize    int
	MaxBackups int
	MaxAge     int
	LogLevel   zapcore.Level
}

Config struct to set up logging by the application

Source Files

Jump to

Keyboard shortcuts

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