Bump google.golang.org/api

This commit is contained in:
Andrea Spacca
2019-03-17 20:19:56 +01:00
parent 8e39b7fa01
commit ec086b4eb3
5432 changed files with 2486664 additions and 231553 deletions

View File

@@ -15,12 +15,13 @@
package logging_test
import (
"context"
"encoding/json"
"fmt"
"os"
"cloud.google.com/go/logging"
"golang.org/x/net/context"
"go.opencensus.io/trace"
)
func ExampleNewClient() {
@@ -164,3 +165,19 @@ func ExampleParseSeverity() {
fmt.Println(sev)
// Output: Alert
}
// This example shows how to create a Logger that disables OpenCensus tracing of the
// WriteLogEntries RPC.
func ExampleContextFunc() {
ctx := context.Background()
client, err := logging.NewClient(ctx, "my-project")
if err != nil {
// TODO: Handle error.
}
lg := client.Logger("logID", logging.ContextFunc(func() (context.Context, func()) {
ctx, span := trace.StartSpan(context.Background(), "this span will not be exported",
trace.WithSampler(trace.NeverSample()))
return ctx, span.End
}))
_ = lg // TODO: Use lg
}