1 // Copyright 2019 The Go Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style
3 // license that can be found in the LICENSE file.
10 "golang.org/x/tools/internal/event/keys"
11 "golang.org/x/tools/internal/event/label"
14 // Log1 takes a message and one label delivers a log event to the exporter.
15 // It is a customized version of Print that is faster and does no allocation.
16 func Log1(ctx context.Context, message string, t1 label.Label) {
17 Export(ctx, MakeEvent([3]label.Label{
23 // Log2 takes a message and two labels and delivers a log event to the exporter.
24 // It is a customized version of Print that is faster and does no allocation.
25 func Log2(ctx context.Context, message string, t1 label.Label, t2 label.Label) {
26 Export(ctx, MakeEvent([3]label.Label{
33 // Metric1 sends a label event to the exporter with the supplied labels.
34 func Metric1(ctx context.Context, t1 label.Label) context.Context {
35 return Export(ctx, MakeEvent([3]label.Label{
41 // Metric2 sends a label event to the exporter with the supplied labels.
42 func Metric2(ctx context.Context, t1, t2 label.Label) context.Context {
43 return Export(ctx, MakeEvent([3]label.Label{
50 // Start1 sends a span start event with the supplied label list to the exporter.
51 // It also returns a function that will end the span, which should normally be
53 func Start1(ctx context.Context, name string, t1 label.Label) (context.Context, func()) {
54 return ExportPair(ctx,
55 MakeEvent([3]label.Label{
59 MakeEvent([3]label.Label{
64 // Start2 sends a span start event with the supplied label list to the exporter.
65 // It also returns a function that will end the span, which should normally be
67 func Start2(ctx context.Context, name string, t1, t2 label.Label) (context.Context, func()) {
68 return ExportPair(ctx,
69 MakeEvent([3]label.Label{
74 MakeEvent([3]label.Label{