moby--moby/vendor/cloud.google.com/go/logging
Cory Snider 00ba5bdb98 Unpin grpc, protobuf dependencies
...in preparation for upgrading containerd.

Signed-off-by: Cory Snider <csnider@mirantis.com>
2022-03-10 17:48:10 -05:00
..
apiv2 Unpin grpc, protobuf dependencies 2022-03-10 17:48:10 -05:00
internal bump cloud.google.com/go v-0.44.3 2020-10-01 23:47:11 +00:00
CHANGES.md Unpin grpc, protobuf dependencies 2022-03-10 17:48:10 -05:00
LICENSE vendor: regenerate 2022-01-18 15:46:04 +01:00
README.md Unpin grpc, protobuf dependencies 2022-03-10 17:48:10 -05:00
doc.go Unpin grpc, protobuf dependencies 2022-03-10 17:48:10 -05:00
go_mod_tidy_hack.go bump cloud.google.com/go v-0.44.3 2020-10-01 23:47:11 +00:00
logging.go Unpin grpc, protobuf dependencies 2022-03-10 17:48:10 -05:00
resource.go Unpin grpc, protobuf dependencies 2022-03-10 17:48:10 -05:00

README.md

Cloud Logging Go Reference

Example Usage

First create a logging.Client to use throughout your application: [snip]:# (logging-1)

ctx := context.Background()
client, err := logging.NewClient(ctx, "my-project")
if err != nil {
   // TODO: Handle error.
}

Usually, you'll want to add log entries to a buffer to be periodically flushed (automatically and asynchronously) to the Cloud Logging service. [snip]:# (logging-2)

logger := client.Logger("my-log")
logger.Log(logging.Entry{Payload: "something happened!"})

Close your client before your program exits, to flush any buffered log entries. [snip]:# (logging-3)

err = client.Close()
if err != nil {
   // TODO: Handle error.
}