internal/spanlog: copies spanlog into the internal directory

This is the first in a series of patches which include an
effort to refactor how the cmd/coordinator is structured. In order
to move buildlet pools into their own package, it would facilitate
the move to have spanlog in it's own internal package. This CL will
be followed by one which removes cmd/coordinator/spanlog and
changes the path of the package for all the callers.

Updates golang/go#36841

Change-Id: Ic310a38f807a3099815e0bdb988edc42b2ca5c85
Reviewed-on: https://go-review.googlesource.com/c/build/+/226843
Run-TryBot: Carlos Amedee <carlos@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Alexander Rakoczy <alex@golang.org>
diff --git a/internal/spanlog/spanlog.go b/internal/spanlog/spanlog.go
new file mode 100644
index 0000000..1040e89
--- /dev/null
+++ b/internal/spanlog/spanlog.go
@@ -0,0 +1,28 @@
+// Copyright 2020 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+// Package spanlog provides span and event logger interfaces.
+package spanlog
+
+// SpanLogger is something that has the CreateSpan method, which
+// creates a event spanning some duration which will eventually be
+// logged and visualized.
+type Logger interface {
+	// CreateSpan logs the start of an event.
+	// optText is 0 or 1 strings.
+	CreateSpan(event string, optText ...string) Span
+}
+
+// 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
+type Span interface {
+	// Done marks a span as done.
+	// The err is returned unmodified for convenience at callsites.
+	Done(err error) error
+}