ctxlog

package module
v0.0.0-...-4f9487c Latest Latest
Warning

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

Go to latest
Published: Feb 26, 2020 License: MIT Imports: 4 Imported by: 1

README

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Debug

func Debug(ctx context.Context, args ...interface{})

Debug logs with level=debug

func Debugf

func Debugf(ctx context.Context, str string, args ...interface{})

Debugf logs with level=debug

func Error

func Error(ctx context.Context, args ...interface{})

Error logs with level=error

func Errorf

func Errorf(ctx context.Context, str string, args ...interface{})

Errorf logs with level=error

func Fatal

func Fatal(ctx context.Context, args ...interface{})

Fatal logs with level=fatal

func Fatalf

func Fatalf(ctx context.Context, str string, args ...interface{})

Fatalf logs with level=fatal

func Info

func Info(ctx context.Context, args ...interface{})

Info logs with level=info

func Infof

func Infof(ctx context.Context, str string, args ...interface{})

Infof logs with level=info

func Warn

func Warn(ctx context.Context, args ...interface{})

Warn logs with level=warn

func Warnf

func Warnf(ctx context.Context, str string, args ...interface{})

Warnf logs with level=warn

func WithKV

func WithKV(ctx context.Context, k string, v interface{}) context.Context

WithKV stores a new logger on the context with k=>v set on it's kv

func WithLogger

func WithLogger(ctx context.Context, l Logger) context.Context

WithLogger stores a new logger on the context

Types

type Logger

type Logger interface {
	Debug(...interface{})
	Info(...interface{})
	Warn(...interface{})
	Error(...interface{})
	Fatal(...interface{})
	Debugf(string, ...interface{})
	Infof(string, ...interface{})
	Warnf(string, ...interface{})
	Errorf(string, ...interface{})
	Fatalf(string, ...interface{})
	KV(string, interface{}) Logger
}

Logger is an interface for leveled logging

func KV

func KV(ctx context.Context, key string, value interface{}) Logger

KV returns a logger with key=value added to context

func L

func L(ctx context.Context) Logger

L returns the logger found on ctx

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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