debugprint

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Dec 5, 2024 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Examples

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Debug

type Debug struct {
	// contains filtered or unexported fields
}

func NewDebug

func NewDebug(beVerbose bool, beMoreVerbose bool) Debug

NewDebug creates a new instance for the debug log printing

func (Debug) Print1f

func (d Debug) Print1f(format string, a ...interface{})

Print1f prints the given message if the debug level is at least 1

Example
d := NewDebug(true, false)
d.color = ""
d.Print1f("hello")
d.Print2f("hello2")
d.Print3f("hello3")
Output:

Debug 1: hello

func (Debug) Print2f

func (d Debug) Print2f(format string, a ...interface{})

Print2f prints the given message if the debug level is at least 2

Example
d := NewDebug(false, true)
d.color = ""
d.Print1f("hello")
d.Print2f("hello2")
d.Print3f("hello3")
Output:

Debug 1: hello
Debug 2: hello2

func (Debug) Print3f

func (d Debug) Print3f(format string, a ...interface{})

Print3f prints the given message if the debug level is at least 3

Example
d := NewDebug(true, true)
d.color = ""
d.Print1f("hello")
d.Print2f("hello2")
d.Print3f("hello3")
Output:

Debug 1: hello
Debug 2: hello2
Debug 3: hello3

func (Debug) Printf

func (d Debug) Printf(level int, format string, a ...interface{})

Printf prints the given message if the debug level is at least the given level

Jump to

Keyboard shortcuts

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