log

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Aug 25, 2022 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FromContext

func FromContext(ctx context.Context) *logrus.Entry

func Initialize

func Initialize(debug bool)

func WithoutContext

func WithoutContext() *logrus.Entry

Types

type TaskIDKeyType

type TaskIDKeyType int
const TaskIDKey TaskIDKeyType = 0

type UpdatableStdout

type UpdatableStdout struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

UpdatableStdout is used to print and update text to stdout. Use this instead of fmt.Print to support updating already output text like progress percentage.

func NewUpdatableStdout

func NewUpdatableStdout() *UpdatableStdout

NewUpdatableStdout creates a new UpdatableStdout instance that can be used to print and update text to stdout

func (*UpdatableStdout) Print

func (p *UpdatableStdout) Print(s string)

Print outputs the specified string as-is on the current line

func (*UpdatableStdout) PrintUpdatable

func (p *UpdatableStdout) PrintUpdatable(id, s string)

PrintUpdatable outputs the specified string on the current line, or updates it in place

func (*UpdatableStdout) PrintUpdatablef

func (p *UpdatableStdout) PrintUpdatablef(id, format string, a ...interface{})

PrintUpdatablef formats and outputs the format string on the current line, or updates it in place

func (*UpdatableStdout) Printf

func (p *UpdatableStdout) Printf(format string, a ...interface{})

Printf formats and outputs the format string on the current line

func (*UpdatableStdout) Println

func (p *UpdatableStdout) Println()

Println outputs an empty line

Jump to

Keyboard shortcuts

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