fields

package
v0.37.1 Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2021 License: GPL-2.0, GPL-3.0 Imports: 2 Imported by: 0

Documentation

Overview

Package fields provides custom log entry fields

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EntryWithFields

func EntryWithFields(fields ...LogEntryField) *logrus.Entry

EntryWithFields returns a new log entry containing the provided fields

Types

type LogEntryField

type LogEntryField func(*logrus.Entry) *logrus.Entry

LogEntryField is a convenience function wrapper for log entry fields

Apply the function in order to make the required changes to a log entry

func Color

func Color(color string) LogEntryField

Color provides a way of coloring a log entry

If no color is provided, a color will be chosen based on the log level.

func DataStream

func DataStream(middleware interface{}, message string) []LogEntryField

DataStream is a convenience function for data stream logs

func Indentation

func Indentation(indentation int) LogEntryField

Indentation sets an indentation level for the log entry

Note that indentation may be ignored at some log levels.

func Info

func Info(info interface{}) LogEntryField

Info adds additional information to the log entry

func Message

func Message(message interface{}) LogEntryField

Message adds a message to the log entry

func Middleware

func Middleware(middleware interface{}) LogEntryField

Middleware adds information about the middleware context to the log entry

func Run

func Run(run interface{}) LogEntryField

Run adds information about the pipeline run context to the log entry

func Symbol

func Symbol(symbol string) LogEntryField

Symbol adds a symbol to illustrate the log entry

func WithReader

func WithReader(reader io.Reader) LogEntryField

WithReader adds an io.Reader to the log entry

The data provided by the reader will be output to the log before the next entry. This is useful for nesting logs.

Jump to

Keyboard shortcuts

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