log

package
v1.18.17 Latest Latest
Warning

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

Go to latest
Published: Nov 5, 2024 License: Apache-2.0 Imports: 8 Imported by: 1

Documentation

Overview

Package log provides logging utilities.

Index

Constants

This section is empty.

Variables

View Source
var (
	Yellow    = color.New(color.FgHiYellow, color.Bold).SprintFunc()
	Green     = color.New(color.FgHiGreen, color.Bold).SprintFunc()
	Blue      = color.New(color.FgHiBlue, color.Bold).SprintFunc()
	Cyan      = color.New(color.FgCyan, color.Bold, color.Underline).SprintFunc()
	Red       = color.New(color.FgHiRed, color.Bold).Add(color.Italic).SprintFunc()
	White     = color.New(color.FgWhite).SprintFunc()
	WhiteBold = color.New(color.FgWhite, color.Bold).SprintFunc()
)

Colors of term style.

Functions

func EnableJSONFormat

func EnableJSONFormat()

EnableJSONFormat enables JSON logging.

func FailureStatusEvent

func FailureStatusEvent(w io.Writer, fmtstr string, a ...interface{})

FailureStatusEvent reports on a failure event.

func InfoStatusEvent

func InfoStatusEvent(w io.Writer, fmtstr string, a ...interface{})

InfoStatusEvent reports status information on an event.

func PendingStatusEvent

func PendingStatusEvent(w io.Writer, fmtstr string, a ...interface{})

PendingStatusEvent reports on a pending event.

func Spinner

func Spinner(w io.Writer, fmtstr string, a ...interface{}) func(result Result)

Spinner is a spinner for long running tasks.

func SuccessStatusEvent

func SuccessStatusEvent(w io.Writer, fmtstr string, a ...interface{})

SuccessStatusEvent reports on a success event.

func WarningStatusEvent

func WarningStatusEvent(w io.Writer, fmtstr string, a ...interface{})

WarningStatusEvent reports on a failure event.

Types

type Result

type Result bool

Result descrbiles the result of a task.

const (
	// Success means true result.
	Success Result = true
	// Failure means false result.
	Failure Result = false
)

Jump to

Keyboard shortcuts

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