ppnocolor

package
v0.0.7 Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2023 License: MIT Imports: 2 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Default = New(3)

Functions

func Errorf

func Errorf(format string, a ...interface{}) error

Errorf formats given arguments and returns it as error type.

func Fatal

func Fatal(a ...interface{})

Fatal prints given arguments and finishes execution with exit status 1.

func Fatalf

func Fatalf(format string, a ...interface{})

Fatalf prints a given format and finishes execution with exit status 1.

func Fatalln

func Fatalln(a ...interface{})

Fatalln prints given arguments with newline and finishes execution with exit status 1.

func Fprint

func Fprint(w io.Writer, a ...interface{}) (n int, err error)

Fprint prints given arguments to a given writer.

func Fprintf

func Fprintf(w io.Writer, format string, a ...interface{}) (n int, err error)

Fprintf prints format to a given writer.

func Fprintln

func Fprintln(w io.Writer, a ...interface{}) (n int, err error)

Fprintln prints given arguments to a given writer with newline.

func GetDefaultOutput

func GetDefaultOutput() io.Writer

GetOutput returns pp's default output.

func New

func New(callerLevel ...int) *pp.PrettyPrinter

func Print

func Print(a ...interface{}) (n int, err error)

Print prints given arguments.

func Printf

func Printf(format string, a ...interface{}) (n int, err error)

Printf prints a given format.

func Println

func Println(a ...interface{}) (n int, err error)

Println prints given arguments with newline.

func ResetColorScheme

func ResetColorScheme()

ResetColorScheme resets colorscheme to default.

func ResetDefaultOutput

func ResetDefaultOutput()

Change Print* functions' output to default one.

func SetColorScheme

func SetColorScheme(scheme pp.ColorScheme)

SetColorScheme takes a colorscheme used by all future Print calls.

func SetDefaultMaxDepth

func SetDefaultMaxDepth(v int)

SetMaxDepth sets the printer's Depth, -1 prints all

func SetDefaultOutput

func SetDefaultOutput(o io.Writer)

Change Print* functions' output to a given writer. For example, you can limit output by ENV.

func init() {
	if os.Getenv("DEBUG") == "" {
		pp.SetDefaultOutput(ioutil.Discard)
	}
}

func Sprint

func Sprint(a ...interface{}) string

Sprint formats given arguments and returns the result as string.

func Sprintf

func Sprintf(format string, a ...interface{}) string

Sprintf formats with pretty print and returns the result as string.

func Sprintln

func Sprintln(a ...interface{}) string

Sprintln formats given arguments with newline and returns the result as string.

Types

This section is empty.

Jump to

Keyboard shortcuts

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