Skip to content

Commit

Permalink
README: attach a logger
Browse files Browse the repository at this point in the history
Signed-off-by: Raphaël Pinson <[email protected]>
  • Loading branch information
raphink committed Sep 11, 2024
1 parent 4a4fc14 commit 69625dc
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ package main

import (
"github.com/isovalent/instruqt-go/instruqt"
"cloud.google.com/go/logging"
)

func main() {
Expand All @@ -47,6 +48,14 @@ func main() {

clientWithTimeout := client.WithContext(ctx)
userInfo, err := clientWithTimeout.GetUserInfo("user-id")

// Attach a logger
logClient, err := logging.NewClient(ctx, "some-gcp-project")
if err != nil {
panic("failed to create log client")
}
stdLogger := logClient.Logger("my-std-logger")
client.InfoLogger = stdLogger.StandardLogger(logging.Info)
}
```

Expand Down

0 comments on commit 69625dc

Please sign in to comment.