1
0
Fork 0
mirror of https://github.com/moby/moby.git synced 2022-11-09 12:21:53 -05:00
moby--moby/vendor/cloud.google.com/go/logging
Sebastiaan van Stijn e5d28115ee
vendor: regenerate
- all changes here are attributed to difference in behaviour between,
  namely:
  - resolution of secondary test dependencies
  - prunning of non-Go files

Signed-off-by: Ilya Dmitrichenko <errordeveloper@gmail.com>
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2022-01-18 15:46:04 +01:00
..
apiv2 bump cloud.google.com/go v-0.44.3 2020-10-01 23:47:11 +00:00
internal bump cloud.google.com/go v-0.44.3 2020-10-01 23:47:11 +00:00
CHANGES.md vendor: regenerate 2022-01-18 15:46:04 +01:00
doc.go bump cloud.google.com/go v-0.44.3 2020-10-01 23:47:11 +00:00
go_mod_tidy_hack.go bump cloud.google.com/go v-0.44.3 2020-10-01 23:47:11 +00:00
LICENSE vendor: regenerate 2022-01-18 15:46:04 +01:00
logging.go bump cloud.google.com/go v-0.44.3 2020-10-01 23:47:11 +00:00
README.md bump cloud.google.com/go v-0.44.3 2020-10-01 23:47:11 +00:00

Stackdriver Logging GoDoc

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 Stackdriver 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.
}