gozap

package module
v0.0.0-...-2adb514 Latest Latest
Warning

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

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

README

gozap

Golang package for providing the interface of integrating uber-zap logging with lumberjack

Documentation

Index

Constants

View Source
const (
	//for verbose logging
	Debug = "debug"

	Info = "info"

	Warn  = "warn"
	Error = "error"
	//Fatal is for logging fatal messages. The sytem shutsdown after logging the message.
	Fatal = "fatal"
)
View Source
const (
	InstanceZapLogger int = iota
)

Variables

This section is empty.

Functions

func Debugf

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

interface impl

func Errorf

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

func Fatalf

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

func Infof

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

func NewLogger

func NewLogger(config Configuration) error

NewLogger returns an instance of logger

func Panicf

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

func Warnf

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

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

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{})

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

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

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

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

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

Jump to

Keyboard shortcuts

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