iprint

package
v0.3.0-alpha2 Latest Latest
Warning

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

Go to latest
Published: Sep 28, 2025 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package iprint contains helper functions for printing information.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Banner()

Banner prints the oscar stylistic banner.

func Debugf

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

Debugf is a helper function that prints debug logs if requested.

func Errorf

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

Errorf is a helper function that writes errors to standard error.

func Goodf

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

Goodf is a helper function that prints green info text indicating something went well

func Infof

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

Infof is a helper function that writes info-level text.

func RunDurationString

func RunDurationString(t time.Time) string

RunDurationString returns a calculated duration used to indicate how long a particular Task (or set of Tasks) took to run.

func Warnf

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

Warnf is a helper function that writes warnings to standard error.

Types

type AllColors

type AllColors struct {
	Reset      string
	Red        string
	Green      string
	Yellow     string
	Blue       string
	Magenta    string
	Cyan       string
	Gray       string
	White      string
	DebugColor string
	InfoColor  string
	WarnColor  string
	ErrorColor string
	GoodColor  string
}

AllColors holds All the possible ANSI color codes that can be used. See the topmost comment in this file for "why".

func Colors

func Colors() AllColors

Colors returns a populated AllColors. It can be used to grab a conditional ANSI color code in message-printing.

For example, to override a print function's default text color with, say, red, you could do something like this:

fmt.Println(iprint.Colors().Red + "oops" + iprint.Colors().Reset)

Jump to

Keyboard shortcuts

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