cli

package
v0.4.3 Latest Latest
Warning

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

Go to latest
Published: Oct 4, 2022 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AnnIsNonoperational = "nonoperational"
)

Variables

View Source
var ErrLogFilePathRequired = errors.New("log file path required")
View Source
var ErrUnknownLogFormat = errors.New("unknown log format")
View Source
var ErrUnknownLogTarget = errors.New("unknown log target defined")

Functions

func IsOperational

func IsOperational(cmd *cobra.Command) bool

func New

func New() (*viper.Viper, *cobra.Command)

New instantiates a new root command with defaults based on submitted type

func Run

func Run()

func ToDaemon

func ToDaemon(c *cobra.Command)

Types

type WriterHook

type WriterHook struct {
	Writer      io.Writer
	Formatter   logrus.Formatter
	LogLevelMin logrus.Level
}

WriterHook is a hook that writes logs of specified LogLevels to specified Writer

func (*WriterHook) Fire

func (hook *WriterHook) Fire(entry *logrus.Entry) error

Fire will be called when some logging function is called with current hook It will format log entry to string and write it to appropriate writer

func (*WriterHook) Levels

func (hook *WriterHook) Levels() []logrus.Level

Levels define on which log levels this hook would trigger

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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