jog

package module
v0.0.0-...-e4af952 Latest Latest
Warning

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

Go to latest
Published: Jun 5, 2022 License: MIT Imports: 9 Imported by: 0

README

jog

Simple logging and tracing utilities adapted from Jaeger HodROD. (See the copyright notices of the relevant source files)

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DevLogger

func DevLogger(logLevel string) (*zap.Logger, error)

func ProdLogger

func ProdLogger(logLevel string) (*zap.Logger, error)

Types

type Logger

type Logger interface {
	Info(msg string, fields ...zapcore.Field)
	Error(msg string, fields ...zapcore.Field)
	Fatal(msg string, fields ...zapcore.Field)
	With(fields ...zapcore.Field) Logger
}

Logger is a simplified abstraction of the zap.Logger

type Logging

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

Logging is the default logging wrapper that can create logger instances either for a given Context or context-less.

func DevLogging

func DevLogging(logLevel string) (Logging, error)

func NewLogging

func NewLogging(logger *zap.Logger) Logging

NewLogging creates a new Logging.

func ProdLogging

func ProdLogging(logLevel string) (Logging, error)

func (Logging) Bg

func (b Logging) Bg() Logger

Bg creates a context-unaware logger.

func (Logging) For

func (b Logging) For(ctx context.Context) Logger

For returns a context-aware Logger. If the context contains an OpenTracing span, all logging calls are also echo-ed into the span.

func (Logging) IsNil

func (b Logging) IsNil() bool

IsNil checks if logging wraps a nil zapLogger

func (Logging) With

func (b Logging) With(fields ...zapcore.Field) Logging

With creates a child logging, and optionally adds some context fields to that logging.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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