logz

package
v0.0.0-...-5391fb3 Latest Latest
Warning

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

Go to latest
Published: Apr 9, 2023 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	HeaderXCorrelationId = "X-Correlation-ID"
	HeaderAuthorization  = "Authorization"
	HeaderCookie         = "Cookie"
	HeaderSetCookie      = "set-cookie"
)

Variables

View Source
var (
	//AppLogger of truedmp/logger is singleton so we use singleton here. As var so we can inject mock.
	AppLogger           logger.Logger
	PatternHiddenHeader = `(?im)^((?:Authorization|Cookie|set-cookie):\s*)([^\r\n]*)`
)

Functions

This section is empty.

Types

type DefaultLog

type DefaultLog struct {
	BegTime        time.Time
	XCorrelationId string
	Data           *logger.Application
}

func (*DefaultLog) Copy

func (l *DefaultLog) Copy() Log

Copy to copy log object with data. AdditionalField is private map so it's the same object (can't clone without reflect/unsafe).

func (*DefaultLog) Error

func (l *DefaultLog) Error(msg interface{})

func (*DefaultLog) GetData

func (l *DefaultLog) GetData() *logger.Application

func (*DefaultLog) Info

func (l *DefaultLog) Info(msg interface{})

func (*DefaultLog) Init

func (l *DefaultLog) Init(r *http.Request, withReqBody bool) Log

func (*DefaultLog) Warning

func (l *DefaultLog) Warning(msg interface{})

type Log

type Log interface {
	Init(r *http.Request, withReqBody bool) Log
	Copy() Log
	Error(msg interface{})
	Info(msg interface{})
	Warning(msg interface{})
	GetData() *logger.Application
}

func NewLogger

func NewLogger() Log

Jump to

Keyboard shortcuts

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