logging

package
v0.15.0 Latest Latest
Warning

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

Go to latest
Published: Feb 27, 2021 License: Apache-2.0 Imports: 4 Imported by: 26

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// Log is the logger used by dobi
	Log = log.New()
)

Functions

func ForTask

func ForTask(repr LogRepresenter) *log.Entry

ForTask returns a logger for a task which implemented LogRepresenter. The logger has the task added as the `task` field.

Types

type Formatter

type Formatter struct{}

Formatter formats a log entry in a human readable way

func (*Formatter) Format

func (f *Formatter) Format(entry *log.Entry) ([]byte, error)

Format implements the log.Formatter interface

type LogRepresenter

type LogRepresenter interface {
	Repr() string
}

LogRepresenter is an interface for objects that can format themselves for logging

Jump to

Keyboard shortcuts

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