golog

package module
v1.0.18 Latest Latest
Warning

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

Go to latest
Published: Nov 15, 2021 License: MIT Imports: 5 Imported by: 0

README

GoLog

Introduction

This package provides logging utility for structured logging. It wraps Zap as its logger by providing convenience method to logs requests, responses and errors.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Initialize added in v1.0.4

func Initialize(sf sinkFunc)

func LogError

func LogError(ctx Context, err error)

func LogInfo added in v1.0.6

func LogInfo(ctx Context, message string)

func LogRequest

func LogRequest(ctx Context, body []byte)

func LogRequestWithHeaders added in v1.0.15

func LogRequestWithHeaders(ctx Context, body []byte, headers map[string][]string)

func LogResponse

func LogResponse(ctx Context, body []byte, status int)

func LogResponseWitHeaders added in v1.0.15

func LogResponseWitHeaders(ctx Context, body []byte, status int, headers map[string][]string)

Types

type Context

type Context interface {
	CorrelationID() string
	Source() string
	StartTime() time.Time
	Method() string
	URL() string
}

Jump to

Keyboard shortcuts

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