logger

package
v0.0.0-...-aefa52a Latest Latest
Warning

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

Go to latest
Published: Apr 5, 2024 License: AGPL-3.0 Imports: 2 Imported by: 0

Documentation

Overview

Package logger provides abstractions over girgen's logging.

Index

Constants

This section is empty.

Variables

View Source
var NoopLogger = noopLogger{}

NoopLogger is a logger that doesn't log anything. It is used as a placeholder to pass into functions that need logging.

Functions

func Prefix

func Prefix(list []interface{}, p interface{}) []interface{}

Prefix prepends the given prefixes into the given value list.

func Stdlog

func Stdlog(logger *log.Logger, minlevel, level Level, v ...interface{})

Stdlog renders the given log entry into the stdlib logger.

Types

type Level

type Level uint8

Level vaguely describes the importance of each log entry.

const (
	// Debug describes logging information that wouldn't be useful for anything
	// except for during debugging.
	Debug Level = iota
	// Skip describes an event that is only used when something is skipped.  The
	// reason for skipping should not be written here and should instead be in
	// Debug.
	Skip
	// Unusual describes an event that is unusual but is not fatal.
	Unusual
	// Error describes an event that is erroneous and will likely not produce a
	// valid output.
	Error
)

type LineLogger

type LineLogger interface {
	Logln(Level, ...interface{})
}

LineLogger describes anything that can log itself.

Jump to

Keyboard shortcuts

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