trace

package
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: Jun 15, 2015 License: BSD-2-Clause Imports: 6 Imported by: 0

Documentation

Overview

Example
package main

import (
	"github.com/remind101/pkg/logger"
	"github.com/remind101/pkg/trace"
	"golang.org/x/net/context"
)

func ping(ctx context.Context) (err error) {
	ctx, done := trace.Trace(ctx)
	defer done(nil, "pong")

	return
}

func main() {
	ctx := context.Background()
	ctx = logger.WithLogger(ctx, logger.Stdout)
	ping(ctx)

	// pong trace.id=<uuid>
	// trace.func=github.com/remind101/pkg/trace_test.ping trace.file=... trace.line=10
}
Output:

Index

Examples

Constants

This section is empty.

Variables

This section is empty.

Functions

func Trace

func Trace(ctx context.Context) (context.Context, func(error, string, ...interface{}))

Types

This section is empty.

Jump to

Keyboard shortcuts

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