logging

package
v0.0.0-...-fad53ba Latest Latest
Warning

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

Go to latest
Published: Apr 16, 2018 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Initialize

func Initialize()

Initialize starts the base logger used by all Doxa components

func LogForGin

func LogForGin(logger *Logger) gin.HandlerFunc

LogForGin returns a gin.HandlerFunc (middleware) that logs requests using Logger.

Requests with errors are logged using log15.Error(). Requests without errors are logged using log15.Info().

func LogPanicData

func LogPanicData(panicData interface{}) error

LogPanicData logs the panic data with stacktrace and return an error with the panic message. This function is separated from LogAndPanic so that unwanted panics can still be logged with this function.

Types

type Logger

type Logger struct {
	log15.Logger
}

A Logger writes logs to a handler

func GetLogger

func GetLogger(moduleName string) *Logger

GetLogger returns a context logger for the given module

func NewLogger

func NewLogger(ctx ...interface{}) *Logger

NewLogger returns a pointer to a new Logger instance

func (*Logger) New

func (l *Logger) New(ctx ...interface{}) *Logger

New returns a new Logger that has this logger's context plus the given context

func (*Logger) Panic

func (l *Logger) Panic(msg string, ctx ...interface{})

Panic logs as an error the given message and context and then panics.

Jump to

Keyboard shortcuts

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