logger

package
v0.1.0-alpha.3 Latest Latest
Warning

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

Go to latest
Published: May 27, 2020 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	//Debug has verbose message
	Debug = "debug"
	//Info is default log level
	Info = "info"
	//Warn is for logging messages about possible issues
	Warn = "warn"
	//Error is for logging errors
	Error = "error"
	//Fatal is for logging fatal messages. The system shutsdown after logging the message.
	Fatal = "fatal"
)
View Source
const (
	InstanceZapLogger int = iota
)

InstanceZapLogger _

Variables

This section is empty.

Functions

func Debugf

func Debugf(format string, args ...interface{})

Debugf _

func Debugw

func Debugw(msg string, args ...interface{})

Debugw _

func Errorf

func Errorf(format string, args ...interface{})

Errorf _

func Errorw

func Errorw(msg string, args ...interface{})

Errorw _

func Fatalf

func Fatalf(format string, args ...interface{})

Fatalf _

func Fatalw

func Fatalw(msg string, args ...interface{})

Fatalw _

func Infof

func Infof(format string, args ...interface{})

Infof _

func Infow

func Infow(msg string, args ...interface{})

Infow _

func NewLogger

func NewLogger(config Configuration, loggerInstance int) error

NewLogger returns an instance of logger

func Panicf

func Panicf(format string, args ...interface{})

Panicf _

func Panicw

func Panicw(msg string, args ...interface{})

Panicw _

func Warnf

func Warnf(format string, args ...interface{})

Warnf _

func Warnw

func Warnw(msg string, args ...interface{})

Warnw _

Types

type Configuration

type Configuration struct {
	EnableConsole     bool
	ConsoleJSONFormat bool
	ConsoleLevel      string
	EnableFile        bool
	FileJSONFormat    bool
	FileLevel         string
	FileLocation      string
}

Configuration stores the config for the logger For some loggers there can only be one level across writers, for such the level of Console is picked by default

type Fields

type Fields map[string]interface{}

Fields Type to pass when we want to call WithFields for structured logging

type Logger

type Logger interface {
	Debugf(format string, args ...interface{})

	Debugw(msg string, args ...interface{})

	Infof(format string, args ...interface{})

	Infow(msg string, args ...interface{})

	Warnf(format string, args ...interface{})

	Warnw(msg string, args ...interface{})

	Errorf(format string, args ...interface{})

	Errorw(msg string, args ...interface{})

	Fatalf(format string, args ...interface{})

	Fatalw(msg string, args ...interface{})

	Panicf(format string, args ...interface{})

	Panicw(msg string, args ...interface{})

	WithFields(keyValues Fields) Logger
}

Logger is our contract for the logger

func WithFields

func WithFields(keyValues Fields) Logger

WithFields _

Jump to

Keyboard shortcuts

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