flag

package
v0.1.5 Latest Latest
Warning

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

Go to latest
Published: Jul 7, 2021 License: AGPL-3.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultFormatter = "text"

DefaultFormatter is a name of a default formatter. This formatter *must* be registered in the FormattersMap map.

View Source
var FormattersMap = map[string]func() logrus.Formatter{
	"text": func() logrus.Formatter {
		return &logrus.TextFormatter{}
	},
	"json": func() logrus.Formatter {
		return &logrus.JSONFormatter{}
	},
}

FormattersMap is a map of supported logrus formatters. It is safe to add custom formatters to this map.

Functions

This section is empty.

Types

type FormatTypeValue

type FormatTypeValue struct {
	// contains filtered or unexported fields
}

FormatTypeValue implements pflag.Value. It represents a flag that allow to choose a different logrus formatter.

func (*FormatTypeValue) Formatter

func (f *FormatTypeValue) Formatter() logrus.Formatter

Formatter returns the logrus.Formatter for selected type.

func (*FormatTypeValue) Set

func (f *FormatTypeValue) Set(v string) error

Set implements the pflag.Value interface.

func (*FormatTypeValue) String

func (f *FormatTypeValue) String() string

String implements the pflag.Value interface.

func (*FormatTypeValue) Type

func (f *FormatTypeValue) Type() string

Type implements the pflag.Value interface.

Jump to

Keyboard shortcuts

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