1
0
Fork 0
mirror of https://github.com/prometheus-operator/prometheus-operator.git synced 2025-04-16 01:06:27 +00:00
prometheus-operator/vendor/github.com/go-stack/stack
2018-01-30 15:30:00 +01:00
..
.travis.yml Uses 'dep' to manage dependencies 2018-01-30 15:30:00 +01:00
format_test.go Uses 'dep' to manage dependencies 2018-01-30 15:30:00 +01:00
LICENSE.md Vendoring kubernetes/client-go 1.8 2017-11-30 13:35:36 +01:00
README.md Vendor dependencies 2016-10-19 16:55:59 +02:00
stack-go19_test.go Uses 'dep' to manage dependencies 2018-01-30 15:30:00 +01:00
stack.go Vendoring kubernetes/client-go 1.8 2017-11-30 13:35:36 +01:00
stack_test.go Uses 'dep' to manage dependencies 2018-01-30 15:30:00 +01:00

GoDoc Go Report Card TravisCI Coverage Status

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 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.

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.