logger

package
v0.0.0-...-f0b5812 Latest Latest
Warning

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

Go to latest
Published: Aug 22, 2022 License: MIT Imports: 4 Imported by: 24

Documentation

Overview

Package logger is a general-use CLI tool logger

Index

Constants

This section is empty.

Variables

View Source
var (
	// StyleError represents the log item style for an error
	StyleError = color.New(color.FgHiRed, color.Bold)
	// StyleFocused represents a log item that should be able to picked out of the mix
	StyleFocused = color.New(color.Bold)
	// StyleInfo is style for an info, or normal, message
	StyleInfo = color.New()
)

Functions

This section is empty.

Types

type Interface

type Interface interface {
	Focused(message string, args ...interface{})
	Error(message string, args ...interface{})
	Errors(messages []string, args ...interface{})
	Info(message string, args ...interface{})
	InfoPart(message string, args ...interface{})
	ListItem(message string, args ...interface{})
	LogPart(message string, style *color.Color, args ...interface{})
	Log(message string, style *color.Color, args ...interface{})
	SpinnerStart(message string)
	SpinnerStop()
}

Interface is an interface for a cli logger

type Logger

type Logger struct{}

Logger is the default logger for vshasta

func (*Logger) Error

func (l *Logger) Error(message string, args ...interface{})

Error will log an error

func (*Logger) Errors

func (l *Logger) Errors(messages []string, args ...interface{})

Errors will log multiple errors

func (*Logger) Focused

func (l *Logger) Focused(message string, args ...interface{})

Focused will log a message that should stand out in the mix

func (*Logger) Info

func (l *Logger) Info(message string, args ...interface{})

Info will log a normal info message

func (*Logger) InfoPart

func (l *Logger) InfoPart(message string, args ...interface{})

InfoPart will log part of line, without breaking so that other log items can still be appended to the line

func (*Logger) ListItem

func (l *Logger) ListItem(message string, args ...interface{})

ListItem will log a line as an item in a list

func (*Logger) Log

func (l *Logger) Log(message string, style *color.Color, args ...interface{})

Log is the main, generic method for outputting log messages

func (*Logger) LogPart

func (l *Logger) LogPart(message string, style *color.Color, args ...interface{})

LogPart will log part of line, without breaking so that other log items can still be appended to the line

func (*Logger) SpinnerStart

func (l *Logger) SpinnerStart(message string)

SpinnerStart will start a spinner/waiting message that will go until we stop it

func (*Logger) SpinnerStop

func (l *Logger) SpinnerStop()

SpinnerStop will stop/cancel a spinner

Jump to

Keyboard shortcuts

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