log

package
v0.0.0-...-af9f243 Latest Latest
Warning

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

Go to latest
Published: Apr 24, 2024 License: Apache-2.0 Imports: 13 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	VerboseFlag bool
	DebugFlag   bool
	JSONFlag    bool
)

Functions

func Check

func Check(err error, msg ...string)

func DefaultJSONFormatter

func DefaultJSONFormatter(i interface{}) ([]byte, error)

func Fatal

func Fatal(args ...any)

func Fatalf

func Fatalf(format string, args ...any)

func GetCLIOutputText

func GetCLIOutputText(outputModel CLIOutput) (string, error)

func HiveLogger

func HiveLogger() *logger.Logger

func Init

func Init(rootCmd *cobra.Command)

func ParseCLIOutputTemplate

func ParseCLIOutputTemplate(output CLIOutput, templateDefinition string) (string, error)

func PrintCLIOutput

func PrintCLIOutput(output CLIOutput)

func PrintTable

func PrintTable(header []string, rows [][]string)

func PrintTree

func PrintTree(node interface{}, tab, tabwidth int)

func Printf

func Printf(format string, args ...interface{})

func Verbosef

func Verbosef(format string, args ...interface{})

Types

type CLIOutput

type CLIOutput interface {
	AsText() (string, error)
}

type ErrorModel

type ErrorModel struct {
	Error string
}

func (*ErrorModel) AsText

func (b *ErrorModel) AsText() (string, error)

type ExtendedCLIOutput

type ExtendedCLIOutput interface {
	CLIOutput
	AsJSON() (string, error)
}

type TreeItem

type TreeItem struct {
	K string
	V interface{}
}

Jump to

Keyboard shortcuts

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