=====
trace
=====
|image0|_ |image1|_ |image2|_
.. |image0| image:: https://godoc.org/github.com/eraclitux/trace?status.svg
.. _image0: https://godoc.org/github.com/eraclitux/trace
.. |image1| image:: https://travis-ci.org/eraclitux/trace.svg?branch=master
.. _image1: https://travis-ci.org/eraclitux/trace
.. |image2| image:: https://goreportcard.com/badge/github.com/eraclitux/trace
.. _image2: https://goreportcard.com/report/github.com/eraclitux/trace
Package ``trace`` is a simple tracing package. See `godoc <https://godoc.org/github.com/eraclitux/trace>`_ for usage examples.
Installation
============
To install with the ``trace-clean`` command::
$ go get github.com/eraclitux/trace/...
Credits
=======
Original idea is by Dave Cheney http://dave.cheney.net.
package main
import (
"fmt"
"github.com/eraclitux/trace"
)
func main() {
s := "my-value"
fmt.Println("This is printed")
// This will print to stderr only if '-tags debug' is used when building/running
trace.Println("Value of s:", s)
}
Printf prints to stderr using supplied format
if '-tags debug' is used when building/running,
otherwise it is a no-op.
stderr is used to not perturb example tests.