Bump google.golang.org/api
This commit is contained in:
19
vendor/cloud.google.com/go/logging/examples_test.go
generated
vendored
19
vendor/cloud.google.com/go/logging/examples_test.go
generated
vendored
@@ -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
|
||||
}
|
||||
|
Reference in New Issue
Block a user