kitloghlp

package
v0.24.0 Latest Latest
Warning

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

Go to latest
Published: Nov 8, 2022 License: Apache-2.0 Imports: 3 Imported by: 1

Documentation

Overview

Package kitloghlp contains some helpers for go-kit/kit/log.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewTestLogger

func NewTestLogger(t testLogger) log.Logger

NewTestLogger returns a Context wrapping a testing.TB.Log.

Types

type LogFunc

type LogFunc func(...interface{}) error

LogFunc is the Log function.

type MultiLogger

type MultiLogger []log.Logger

func (MultiLogger) Log

func (m MultiLogger) Log(keyvals ...interface{}) error

type StringWrap

type StringWrap struct {
	Value interface{}
}

StringWrap wraps the Value as a fmt.Stringer.

func (StringWrap) String

func (sw StringWrap) String() string

String returns a string representation (%v) of the underlying Value.

type Stringify

type Stringify struct {
	log.Logger
}

Stringify stringifies every value to make it printable by logfmt.

Example:

Logger := log.LogfmtLogger(os.Stderr)
Logger = log.Stringify{Logger}

func New

func New(w io.Writer) Stringify

New returns a Logger, using Logfmt logger with Stringify on w.

func (Stringify) Log

func (l Stringify) Log(keyvals ...interface{}) error

Log with stringifying every value.

Jump to

Keyboard shortcuts

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