diff options
author | Péter Szilágyi <peterke@gmail.com> | 2017-02-20 23:39:36 +0800 |
---|---|---|
committer | Péter Szilágyi <peterke@gmail.com> | 2017-02-23 18:00:02 +0800 |
commit | ec7f81f4bc11c6f8203ec1d3055c9a09a244ff43 (patch) | |
tree | 5ec75ddab7749a9d0c47a97d6f638b52e6ebc6bb /vendor/github.com/go-stack/stack/README.md | |
parent | 29fac7de448c85049a97cbec3dc0819122bd2cb0 (diff) | |
download | go-tangerine-ec7f81f4bc11c6f8203ec1d3055c9a09a244ff43.tar go-tangerine-ec7f81f4bc11c6f8203ec1d3055c9a09a244ff43.tar.gz go-tangerine-ec7f81f4bc11c6f8203ec1d3055c9a09a244ff43.tar.bz2 go-tangerine-ec7f81f4bc11c6f8203ec1d3055c9a09a244ff43.tar.lz go-tangerine-ec7f81f4bc11c6f8203ec1d3055c9a09a244ff43.tar.xz go-tangerine-ec7f81f4bc11c6f8203ec1d3055c9a09a244ff43.tar.zst go-tangerine-ec7f81f4bc11c6f8203ec1d3055c9a09a244ff43.zip |
log, vendor: vendor in log15 inline into our codebase
Diffstat (limited to 'vendor/github.com/go-stack/stack/README.md')
-rw-r--r-- | vendor/github.com/go-stack/stack/README.md | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/vendor/github.com/go-stack/stack/README.md b/vendor/github.com/go-stack/stack/README.md new file mode 100644 index 000000000..f11ccccaa --- /dev/null +++ b/vendor/github.com/go-stack/stack/README.md @@ -0,0 +1,38 @@ +[![GoDoc](https://godoc.org/github.com/go-stack/stack?status.svg)](https://godoc.org/github.com/go-stack/stack) +[![Go Report Card](https://goreportcard.com/badge/go-stack/stack)](https://goreportcard.com/report/go-stack/stack) +[![TravisCI](https://travis-ci.org/go-stack/stack.svg?branch=master)](https://travis-ci.org/go-stack/stack) +[![Coverage Status](https://coveralls.io/repos/github/go-stack/stack/badge.svg?branch=master)](https://coveralls.io/github/go-stack/stack?branch=master) + +# stack + +Package stack implements utilities to capture, manipulate, and format call +stacks. It provides a simpler API than package runtime. + +The implementation takes care of the minutia and special cases of interpreting +the program counter (pc) values returned by runtime.Callers. + +## Versioning + +Package stack publishes releases via [semver](http://semver.org/) compatible Git +tags prefixed with a single 'v'. The master branch always contains the latest +release. The develop branch contains unreleased commits. + +## Formatting + +Package stack's types implement fmt.Formatter, which provides a simple and +flexible way to declaratively configure formatting when used with logging or +error tracking packages. + +```go +func DoTheThing() { + c := stack.Caller(0) + log.Print(c) // "source.go:10" + log.Printf("%+v", c) // "pkg/path/source.go:10" + log.Printf("%n", c) // "DoTheThing" + + s := stack.Trace().TrimRuntime() + log.Print(s) // "[source.go:15 caller.go:42 main.go:14]" +} +``` + +See the docs for all of the supported formatting options. |