logger

package
v0.0.0-...-2c2efe1 Latest Latest
Warning

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

Go to latest
Published: Dec 12, 2019 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Overview

Package logger - configurable logging middleware

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewLogTextLogger

func NewLogTextLogger(w io.Writer) kitlog.Logger

NewLogTextLogger returns a logger that encodes keyvals to the Writer in plain text format. The passed Writer must be safe for concurrent use by multiple goroutines if the returned Logger will be used concurrently.

Types

type Logger

type Logger struct {
	// contains filtered or unexported fields
}

Logger implements go-kit logger interface Adding additional functionality

func NewLogger

func NewLogger(logType, logLevel string, options ...Option) (*Logger, error)

NewLogger initializes a new Logger instance Supported log types are: text, json, none

func (*Logger) Debug

func (l *Logger) Debug(msg string, vals ...interface{})

Debug log

func (*Logger) Error

func (l *Logger) Error(msg string, vals ...interface{})

Error log

func (*Logger) Info

func (l *Logger) Info(msg string, vals ...interface{})

Info log

func (*Logger) Log

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

Log satisfies Logger interface

func (*Logger) Request

func (l *Logger) Request(reqID, method, path string)

Request log

func (*Logger) Response

func (l *Logger) Response(reqID, method, path string, statusCode int, statusText string, reqTime time.Duration)

Response log

type Option

type Option func(l *Logger) error

Option for adding additional configurations of Logger instance

func With

func With(k, v interface{}) Option

With adds additional values to the logger

Jump to

Keyboard shortcuts

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