log

package
v0.0.0-alpha9 Latest Latest
Warning

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

Go to latest
Published: Mar 21, 2023 License: GPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetLogger

func GetLogger(ctx context.Context) *logrus.Logger

GetLogger returns a logger previously set with SetLoggerValue.

func IndentLogger

func IndentLogger(ctx context.Context) context.Context

IndentLogger receives a context with a previously set logger (SetLoggerValue), and returns a copy of it but with a logger with one extra indentation.

func SetLoggerValue

func SetLoggerValue(
	ctx context.Context, output io.Writer, logLevelStr string, exitFunc func(int),
) context.Context

SetLoggerValue returns a copy of the context with a logger value set.

Types

type ColorFormatter

type ColorFormatter struct {
	// Indent defines by how much to indent each log line
	Indent int
}

ColorFormatter is a formatter that uses different colors for each level.

func (*ColorFormatter) Format

func (cf *ColorFormatter) Format(entry *logrus.Entry) ([]byte, error)

Jump to

Keyboard shortcuts

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