nest

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Dec 18, 2019 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

Package nest allows users to use a Logger interface to create another Logger interface.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(log log.Logger, v ...interface{}) *logger

func Newf

func Newf(log log.Logger, format string, v ...interface{}) *logger

Types

type Marker

type Marker string

Marker is a string synonym. The type difference allows underlying log implementations to distinguish between the PreNest marker and a "pre-nest" string literal.

const (
	// PreNest is a marker placed between the parent and child values
	// when calling the wrapped Log method.  For example:
	//
	//   parent := SomeLogger()
	//	 child := New(parent, "a", "b")
	//	 child.Log("c", "d")
	//
	// will result in:
	//
	//    parent.Log("a", "b", PreLog, "c", "d")
	PreNest Marker = "pre-nest"
)

func (Marker) String

func (m Marker) String() string

String returns a single space (regardless of the underlying marker string). This makes the output of parent loggers based on a fmt.Print style more readable, because fmt.Print only inserts space between two non-string operands.

Jump to

Keyboard shortcuts

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