From 77e9aad74c6ddbbacad83ed7bc46eff8c1c8ab41 Mon Sep 17 00:00:00 2001 From: Simon Zeltser Date: Wed, 14 Oct 2020 07:18:02 -0700 Subject: [PATCH] refactor(logging): Debranding of Stackdriver (#2839) 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. --- CONTRIBUTING.md | 2 +- internal/.repo-metadata-full.json | 2 +- internal/gapicgen/generator/gapics.go | 2 +- logging/README.md | 10 +++++----- logging/doc.go | 10 +++++----- logging/internal/testing/fake.go | 8 ++++---- logging/logadmin/logadmin.go | 2 +- logging/logadmin/metrics.go | 2 +- logging/logadmin/sinks.go | 4 ++-- 9 files changed, 21 insertions(+), 21 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 00adbb0bbf90..e59fe2216c23 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -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 cloud-logs@google.com:O gs://$GCLOUD_TESTS_GOLANG_PROJECT_ID diff --git a/internal/.repo-metadata-full.json b/internal/.repo-metadata-full.json index f8929438c446..33c9f8dafcc9 100644 --- a/internal/.repo-metadata-full.json +++ b/internal/.repo-metadata-full.json @@ -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", diff --git a/internal/gapicgen/generator/gapics.go b/internal/gapicgen/generator/gapics.go index b818c2b6b53a..9ead5cc2da4c 100644 --- a/internal/gapicgen/generator/gapics.go +++ b/internal/gapicgen/generator/gapics.go @@ -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", diff --git a/logging/README.md b/logging/README.md index 06050110e4ee..242c7f14f7e7 100644 --- a/logging/README.md +++ b/logging/README.md @@ -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 @@ -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") @@ -32,4 +32,4 @@ err = client.Close() if err != nil { // TODO: Handle error. } -``` \ No newline at end of file +``` diff --git a/logging/doc.go b/logging/doc.go index 2735cba314c1..10b82b2d6b3c 100644 --- a/logging/doc.go +++ b/logging/doc.go @@ -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. @@ -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() @@ -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") @@ -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() @@ -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 diff --git a/logging/internal/testing/fake.go b/logging/internal/testing/fake.go index ecec835d5444..dcf3d60dcfb2 100644 --- a/logging/internal/testing/fake.go +++ b/logging/internal/testing/fake.go @@ -95,8 +95,8 @@ const ( SharedServiceAccount = "serviceAccount:cloud-logs@system.gserviceaccount.com" ) -// 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) @@ -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". @@ -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{ diff --git a/logging/logadmin/logadmin.go b/logging/logadmin/logadmin.go index a8db95e158d3..288e0d6bf5b0 100644 --- a/logging/logadmin/logadmin.go +++ b/logging/logadmin/logadmin.go @@ -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. // diff --git a/logging/logadmin/metrics.go b/logging/logadmin/metrics.go index 2f673b64b637..c6da68416a1c 100644 --- a/logging/logadmin/metrics.go +++ b/logging/logadmin/metrics.go @@ -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: diff --git a/logging/logadmin/sinks.go b/logging/logadmin/sinks.go index 2b54fe8625fb..c7d7a6bc74a9 100644 --- a/logging/logadmin/sinks.go +++ b/logging/logadmin/sinks.go @@ -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). @@ -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. //