A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from http://cloud.google.com/cpp/docs/reference/storage/2.22.1/storage-env below:

C++ Client Libraries | Google Cloud

Skip to main content

Stay organized with collections Save and categorize content based on your preferences.

Environment Variables

A number of environment variables can be used to configure the behavior of the library. There are also functions to configure this behavior in code. The environment variables are convenient when troubleshooting problems.

Setting the Default Project

Some of the GCS APIs need a project as a parameter. For such APIs the application can (a) call an overload that takes the project id as a parameter, (b) define the project explicitly when the Client object is constructed, or (c) set the GOOGLE_CLOUD_PROJECT environment variable to the desired project id. If you have set this environment variable the code can be even simpler:

  namespace gcs = ::google::cloud::storage;
  using ::google::cloud::StatusOr;
  [](gcs::Client client, std::string const& bucket_name) {
    StatusOr<gcs::BucketMetadata> bucket_metadata =
        client.CreateBucket(bucket_name, gcs::BucketMetadata());
    if (!bucket_metadata) throw std::move(bucket_metadata).status();

    std::cout << "Bucket " << bucket_metadata->name() << " created."
              << "\nFull Metadata: " << *bucket_metadata << "\n";
  }
See Also

google::cloud::storage::ProjectIdOption

Endpoint Overrides

CLOUD_STORAGE_EMULATOR_ENDPOINT=...: override the default endpoint used by the library. Intended for testing only.

CLOUD_STORAGE_TESTBENCH_ENDPOINT=...: DEPRECATED please use CLOUD_STORAGE_EMULATOR_ENDPOINT instead.

See Also

google::cloud::storage::RestEndpointOption

See Also

google::cloud::storage::IamEndpointOption

Enabling Experimental Behaviors

GOOGLE_CLOUD_CPP_STORAGE_REST_CONFIG=...: configuration for the REST protocol, but currently unused.

GOOGLE_CLOUD_CPP_STORAGE_GRPC_CONFIG=...: used with google::cloud::storage_experimental::DefaultGrpcClient() to configure configure the gRPC protocol. Setting this to media enables gRPC for just media operations (reading and writing data), while setting this to metadata enables gRPC for all operations. Note that gRPC support is an early access program. Contact Google Cloud support for details.

See Also

google::cloud::storage_experimental::GrpcPluginOption

Logging

CLOUD_STORAGE_ENABLE_TRACING=raw-client: enables logging for each "RPC" generated by the library. Unless you have configured your own logging backend, you should also set GOOGLE_CLOUD_CPP_ENABLE_CLOG to produce any output on the program's console.

CLOUD_STORAGE_ENABLE_TRACING=http: enables logging for the full http traffic generated by the library.

CLOUD_STORAGE_ENABLE_TRACING=raw-client,http: enables all logging.

See Also

google::cloud::GrpcTracingOptionsOptionGOOGLE_CLOUD_CPP_ENABLE_CLOG=yes: turns on logging in the library, basically the library always "logs" but the logging infrastructure has no backend to actually print anything until the application sets a backend or they set this environment variable.

See Also

google::cloud::LogBackend

See Also

google::cloud::LogSink

Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2025-08-14 UTC.

[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-08-14 UTC."],[[["This document provides reference information for different versions of the C++ storage library, ranging from version 2.11.0 up to the latest release candidate, 2.37.0-rc."],["Environment variables can be used to configure the library's behavior, including setting the default project, overriding endpoints for testing or using an emulator, and enabling experimental gRPC features."],["The `GOOGLE_CLOUD_PROJECT` environment variable simplifies code by setting the default project ID for APIs that require it, eliminating the need to specify the project explicitly in each call or when constructing the `Client` object."],["Tracing and logging can be enabled through environment variables like `CLOUD_STORAGE_ENABLE_TRACING` and `GOOGLE_CLOUD_CPP_ENABLE_CLOG`, which help in troubleshooting by logging RPC calls and HTTP traffic."],["The library supports experimental features like gRPC, configurable through the `GOOGLE_CLOUD_CPP_STORAGE_GRPC_CONFIG` environment variable, which can be set to enable gRPC for media operations or all operations."]]],[]]


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4