spanlog

package
Version: v0.0.0-...-cbf6b04 Latest Latest
Warning

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

Go to latest
Published: Sep 27, 2022 License: BSD-3-Clause Imports: 0 Imported by: 0

README

Go Reference

golang.org/x/build/internal/spanlog

Package spanlog provides span and event logger interfaces.

Documentation

Overview

Package spanlog provides span and event logger interfaces.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Logger

type Logger interface {
	// CreateSpan logs the start of an event.
	// optText is 0 or 1 strings.
	CreateSpan(event string, optText ...string) Span
}

SpanLogger is something that has the CreateSpan method, which creates a event spanning some duration which will eventually be logged and visualized.

type Span

type Span interface {
	// Done marks a span as done.
	// The err is returned unmodified for convenience at callsites.
	Done(err error) error
}

Span is a handle that can eventually be closed. Typical usage:

sp := sl.CreateSpan("slow_operation")
result, err := doSlowOperation()
sp.Done(err)
// do something with result, err

Source Files

Jump to

Keyboard shortcuts

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