loglib

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: May 21, 2021 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Package loglib is for encapsulating https://github.com/uber-go/zap any operations

As a quick start for loglib:

	logger, err := loglib.NewProductionLogger()
	if err != nil {
		panic(err)
	}
	logger.Info("test logger", zap.String("hello", "world"))

 logger, err := loglib.NewProductionLogger()
	if err != nil {
		panic(err)
	}
	logger.Log(loglib.INFO, "test logger", "hello", "world")

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Level added in v0.0.8

type Level string
const (
	DEBUG  Level = "DEBUG"
	INFO   Level = "INFO"
	WARN   Level = "WARN"
	ERROR  Level = "ERROR"
	DPANIC Level = "DPANIC"
	PANIC  Level = "PANIC"
	FATAL  Level = "FATAL"
)

type Logger

type Logger struct {
	*zap.Logger
}

func NewDevelopmentLogger

func NewDevelopmentLogger(options ...zap.Option) (*Logger, error)

func NewNopLogger

func NewNopLogger() *Logger

func NewProductionLogger

func NewProductionLogger(options ...zap.Option) (*Logger, error)

func (*Logger) Log added in v0.0.8

func (l *Logger) Log(keyvals ...interface{}) error

in order to fit go-kit logger interface

func (*Logger) With added in v0.0.9

func (l *Logger) With(fields ...zap.Field)

Jump to

Keyboard shortcuts

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