Skip to content

Commit

Permalink
refactor(logging): Debranding of Stackdriver (#2839)
Browse files Browse the repository at this point in the history
Fixes #3007 
Stackdriver Logging is now called Cloud Logging, so we are debranding across all Cloud Logging repos.

Here is the update for the readme of logging client library in Go.
  • Loading branch information
Simon Zeltser authored Oct 14, 2020
1 parent 0113f76 commit 77e9aad
Show file tree
Hide file tree
Showing 9 changed files with 21 additions and 21 deletions.
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ $ gcloud auth login
$ gcloud datastore indexes create datastore/testdata/index.yaml

# Creates a Google Cloud storage bucket with the same name as your test project,
# and with the Stackdriver Logging service account as owner, for the sink
# and with the Cloud Logging service account as owner, for the sink
# integration tests in logging.
$ gsutil mb gs://$GCLOUD_TESTS_GOLANG_PROJECT_ID
$ gsutil acl ch -g [email protected]:O gs://$GCLOUD_TESTS_GOLANG_PROJECT_ID
Expand Down
2 changes: 1 addition & 1 deletion internal/.repo-metadata-full.json
Original file line number Diff line number Diff line change
Expand Up @@ -433,7 +433,7 @@
},
"cloud.google.com/go/logging": {
"distribution_name": "cloud.google.com/go/logging",
"description": "Stackdriver Logging API",
"description": "Cloud Logging API",
"language": "Go",
"client_library_type": "manual",
"docs_url": "https://pkg.go.dev/cloud.google.com/go/logging",
Expand Down
2 changes: 1 addition & 1 deletion internal/gapicgen/generator/gapics.go
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@ var manualEntries = []manifestEntry{
},
{
DistributionName: "cloud.google.com/go/logging",
Description: "Stackdriver Logging API",
Description: "Cloud Logging API",
Language: "Go",
ClientLibraryType: "manual",
DocsURL: "https://pkg.go.dev/cloud.google.com/go/logging",
Expand Down
10 changes: 5 additions & 5 deletions logging/README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
## Stackdriver Logging [![GoDoc](https://godoc.org/cloud.google.com/go/logging?status.svg)](https://godoc.org/cloud.google.com/go/logging)
## Cloud Logging [![GoDoc](https://godoc.org/cloud.google.com/go/logging?status.svg)](https://godoc.org/cloud.google.com/go/logging)

- [About Stackdriver Logging](https://cloud.google.com/logging/)
- [About Cloud Logging](https://cloud.google.com/logging/)
- [API documentation](https://cloud.google.com/logging/docs)
- [Go client documentation](https://godoc.org/cloud.google.com/go/logging)
- [Go client documentation](https://pkg.go.dev/cloud.google.com/go/logging)
- [Complete sample programs](https://github.com/GoogleCloudPlatform/golang-samples/tree/master/logging)

### Example Usage
Expand All @@ -18,7 +18,7 @@ if err != nil {
```

Usually, you'll want to add log entries to a buffer to be periodically flushed
(automatically and asynchronously) to the Stackdriver Logging service.
(automatically and asynchronously) to the Cloud Logging service.
[snip]:# (logging-2)
```go
logger := client.Logger("my-log")
Expand All @@ -32,4 +32,4 @@ err = client.Close()
if err != nil {
// TODO: Handle error.
}
```
```
10 changes: 5 additions & 5 deletions logging/doc.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
// limitations under the License.

/*
Package logging contains a Stackdriver Logging client suitable for writing logs.
Package logging contains a Cloud Logging client suitable for writing logs.
For reading logs, and working with sinks, metrics and monitored resources,
see package cloud.google.com/go/logging/logadmin.
Expand All @@ -23,7 +23,7 @@ See https://cloud.google.com/logging/docs/api/v2/ for an introduction to the API
Creating a Client
Use a Client to interact with the Stackdriver Logging API.
Use a Client to interact with the Cloud Logging API.
// Create a Client
ctx := context.Background()
Expand All @@ -36,7 +36,7 @@ Use a Client to interact with the Stackdriver Logging API.
Basic Usage
For most use cases, you'll want to add log entries to a buffer to be periodically
flushed (automatically and asynchronously) to the Stackdriver Logging service.
flushed (automatically and asynchronously) to the Cloud Logging service.
// Initialize a logger
lg := client.Logger("my-log")
Expand All @@ -47,7 +47,7 @@ flushed (automatically and asynchronously) to the Stackdriver Logging service.
Closing your Client
You should call Client.Close before your program exits to flush any buffered log entries to the Stackdriver Logging service.
You should call Client.Close before your program exits to flush any buffered log entries to the Cloud Logging service.
// Close the client when finished.
err = client.Close()
Expand Down Expand Up @@ -106,7 +106,7 @@ An Entry may have one of a number of severity levels associated with it.
Viewing Logs
You can view Stackdriver logs for projects at
You can view Cloud logs for projects at
https://console.cloud.google.com/logs/viewer. Use the dropdown at the top left. When
running from a Google Cloud Platform VM, select "GCE VM Instance". Otherwise, select
"Google Project" and then the project ID. Logs for organizations, folders and billing
Expand Down
8 changes: 4 additions & 4 deletions logging/internal/testing/fake.go
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,8 @@ const (
SharedServiceAccount = "serviceAccount:[email protected]"
)

// WriteLogEntries writes log entries to Stackdriver Logging. All log entries in
// Stackdriver Logging are written by this method.
// WriteLogEntries writes log entries to Cloud Logging. All log entries in
// Cloud Logging are written by this method.
func (h *loggingHandler) WriteLogEntries(_ context.Context, req *logpb.WriteLogEntriesRequest) (*logpb.WriteLogEntriesResponse, error) {
if !strings.HasPrefix(req.LogName, "projects/"+ValidProjectID+"/") && !strings.HasPrefix(req.LogName, "organizations/"+ValidOrgID+"/") {
return nil, fmt.Errorf("bad LogName: %q", req.LogName)
Expand Down Expand Up @@ -130,7 +130,7 @@ func (h *loggingHandler) WriteLogEntries(_ context.Context, req *logpb.WriteLogE
}

// ListLogEntries lists log entries. Use this method to retrieve log entries
// from Stackdriver Logging.
// from Cloud Logging.
//
// This fake implementation ignores project IDs. It does not support full filtering, only
// expressions of the form "logName = NAME".
Expand Down Expand Up @@ -222,7 +222,7 @@ func compareTimestamps(ts1, ts2 *tspb.Timestamp) int64 {
return int64(ts1.Nanos - ts2.Nanos)
}

// Lists monitored resource descriptors that are used by Stackdriver Logging.
// Lists monitored resource descriptors that are used by Cloud Logging.
func (h *loggingHandler) ListMonitoredResourceDescriptors(context.Context, *logpb.ListMonitoredResourceDescriptorsRequest) (*logpb.ListMonitoredResourceDescriptorsResponse, error) {
return &logpb.ListMonitoredResourceDescriptorsResponse{
ResourceDescriptors: []*mrpb.MonitoredResourceDescriptor{
Expand Down
2 changes: 1 addition & 1 deletion logging/logadmin/logadmin.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
// These features are missing now, but will likely be added:
// - There is no way to specify CallOptions.

// Package logadmin contains a Stackdriver Logging client that can be used
// Package logadmin contains a Cloud Logging client that can be used
// for reading logs and working with sinks, metrics and monitored resources.
// For a client that can write logs, see package cloud.google.com/go/logging.
//
Expand Down
2 changes: 1 addition & 1 deletion logging/logadmin/metrics.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import (
// Metric describes a logs-based metric. The value of the metric is the
// number of log entries that match a logs filter.
//
// Metrics are a feature of Stackdriver Monitoring.
// Metrics are a feature of Cloud Monitoring.
// See https://cloud.google.com/monitoring/api/v3/metrics for more about them.
type Metric struct {
// ID is a client-assigned metric identifier. Example:
Expand Down
4 changes: 2 additions & 2 deletions logging/logadmin/sinks.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import (
maskpb "google.golang.org/genproto/protobuf/field_mask"
)

// Sink describes a sink used to export log entries outside Stackdriver
// Sink describes a sink used to export log entries outside Cloud
// Logging. Incoming log entries matching a filter are exported to a
// destination (a Cloud Storage bucket, BigQuery dataset or Cloud Pub/Sub
// topic).
Expand Down Expand Up @@ -95,7 +95,7 @@ type SinkOptions struct {
// Determines the kind of IAM identity returned as WriterIdentity in the new
// sink. If this value is omitted or set to false, and if the sink's parent is a
// project, then the value returned as WriterIdentity is the same group or
// service account used by Stackdriver Logging before the addition of writer
// service account used by Cloud Logging before the addition of writer
// identities to the API. The sink's destination must be in the same project as
// the sink itself.
//
Expand Down

0 comments on commit 77e9aad

Please sign in to comment.