Skip to content

Commit

Permalink
Merge branch 'master' into regen_gocloud
Browse files Browse the repository at this point in the history
  • Loading branch information
bcoe committed Oct 29, 2020
2 parents 3791ff6 + 07004ba commit aaac111
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 3 deletions.
3 changes: 2 additions & 1 deletion .github/CODEOWNERS
Validating CODEOWNERS rules …
Expand Up @@ -5,7 +5,8 @@
/bigquery/ @googleapis/api-bigquery
/datastore/ @tritone
/firestore/ @tritone
/logging/ @nicoleczhu
/pubsub/ @googleapis/api-pubsub
/spanner/ @skuruppu
/storage/ @tritone
/errorreporting/ @googleapis/api-logging
/logging/ @googleapis/api-logging
5 changes: 5 additions & 0 deletions .github/blunderbuss.yml
Expand Up @@ -22,3 +22,8 @@ assign_issues_by:
- 'api: spanner'
to:
- skuruppu
- labels:
- 'api: logging'
- 'api: clouderrorreporting'
to:
- nicolezhu
7 changes: 5 additions & 2 deletions logging/README.md
Expand Up @@ -9,27 +9,30 @@

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

```go
ctx := context.Background()
client, err := logging.NewClient(ctx, "my-project")
if err != nil {
// TODO: Handle error.
// 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)

```go
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)

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

0 comments on commit aaac111

Please sign in to comment.