log

package module
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Aug 25, 2020 License: MIT Imports: 6 Imported by: 8

README

go-log

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Debug

func Debug(args ...interface{})

func DebugWithFields

func DebugWithFields(fields Fields, args ...interface{})

func DebugWithFieldsf added in v0.3.0

func DebugWithFieldsf(fields Fields, message string, args ...interface{})

func Debugf

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

func Error

func Error(args ...interface{})

func ErrorWithFields

func ErrorWithFields(fields Fields, args ...interface{})

func ErrorWithFieldsf added in v0.3.0

func ErrorWithFieldsf(fields Fields, message string, args ...interface{})

func Errorf

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

func Fatal

func Fatal(args ...interface{})

func FatalWithFields

func FatalWithFields(fields Fields, args ...interface{})

func FatalWithFieldsf added in v0.3.0

func FatalWithFieldsf(fields Fields, message string, args ...interface{})

func Fatalf

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

func Info

func Info(args ...interface{})

func InfoWithFields

func InfoWithFields(fields Fields, args ...interface{})

func InfoWithFieldsf added in v0.3.0

func InfoWithFieldsf(fields Fields, message string, args ...interface{})

func Infof

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

func New

func New(isProduction bool, logLevel string) *logrus.Logger

New - Creates a new instance of logrus with customized configuration

func Panic

func Panic(args ...interface{})

func PanicWithFields

func PanicWithFields(fields Fields, args ...interface{})

func PanicWithFieldsf added in v0.3.0

func PanicWithFieldsf(fields Fields, message string, args ...interface{})

func Panicf

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

func ServerLogger

func ServerLogger() func(next http.Handler) http.Handler

ServerLogger is a middleware that logs the start and end of each request, along with some useful data about what was requested, what the response status was, and how long it took to return.

func Warn

func Warn(args ...interface{})

func WarnWithFields

func WarnWithFields(fields Fields, args ...interface{})

func WarnWithFieldsf added in v0.3.0

func WarnWithFieldsf(fields Fields, message string, args ...interface{})

func Warnf

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

func Writer

func Writer() *io.PipeWriter

Types

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 {
	Info(args ...interface{})
	Infof(message string, args ...interface{})
	Debug(args ...interface{})
	Debugf(message string, args ...interface{})
	Error(args ...interface{})
	Errorf(message string, args ...interface{})
	Warn(args ...interface{})
	Warnf(message string, args ...interface{})
	Fatal(args ...interface{})
	Fatalf(message string, args ...interface{})
	Panic(args ...interface{})
	Panicf(message string, args ...interface{})
	Writer() *io.PipeWriter
}

Logger interface

func RequestLogger

func RequestLogger(ctx context.Context) Logger

RequestLogger creates a logger with the request ID on it

Jump to

Keyboard shortcuts

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