Google Cloud Storage C++ Client 2.13.0
A C++ Client Library for Google Cloud Storage
|
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.
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:
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.
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.
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.
GOOGLE_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.