vrb

package module
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Apr 30, 2020 License: Apache-2.0 Imports: 3 Imported by: 0

README

vrb

Convenient verbose output library.

Inspired by paulvollmer/go-verbose, but trying to keep an usage pattern similar to fmt.

How to use

Initialize the package once at the start of your command:

import "github.com/telegrapher/vrb"

...

// Write the verbose messages to os.Stderr
// Without any initialization, they'll be discarded
if verbose {
    vrb.Init(os.Stderr)
}

Use "vrb" the same way you would use "fmt":


fmt.Println("This text goes to STDOUT")
vrb.Println("This is verbose-only text and goes to STDERR")

Documentation

Overview

Example
package main

import (
	"os"

	"github.com/telegrapher/vrb"
)

func main() {
	vrb.Init(os.Stderr)
	vrb.Println("Verbose message in stderr.")
}

Index

Examples

Constants

This section is empty.

Variables

This section is empty.

Functions

func Init

func Init(wrtr io.Writer)

Public method to initialize the verbose io.Writer

func Print

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

Print usage is equivalent to https://golang.org/pkg/fmt/#Print

func Printf

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

Printf usage is equivalent to https://golang.org/pkg/fmt/#Printf

func Println

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

Println usage is equivalent to https://golang.org/pkg/fmt/#Println

Types

This section is empty.

Jump to

Keyboard shortcuts

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