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.15.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 a comprehensive list of C++ storage library versions, ranging from the latest release candidate (2.37.0-rc) down to version 2.11.0, each with corresponding links to its documentation."],["Environment variables can be utilized to modify the behavior of the library, such as `GOOGLE_CLOUD_PROJECT` for setting the default project and `CLOUD_STORAGE_EMULATOR_ENDPOINT` for overriding the default endpoint."],["The document details how to enable experimental features, including the configuration of the gRPC protocol for media or all operations via the `GOOGLE_CLOUD_CPP_STORAGE_GRPC_CONFIG` variable."],["Various logging options are outlined, including the ability to trace raw client interactions or HTTP traffic by setting `CLOUD_STORAGE_ENABLE_TRACING`, and enabling logging output with `GOOGLE_CLOUD_CPP_ENABLE_CLOG`."]]],[]]


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