| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Name | Name | Last commit date | ||
|---|---|---|---|---|
In order to use this library, you first need to go through the following steps:
Install this library in a virtualenv using pip. virtualenv is a tool to create isolated Python environments. The basic problem it addresses is one of dependencies and versions, and indirectly permissions.
With virtualenv, it's possible to install this library without needing system install permissions, and without clashing with the installed system dependencies.
python3 -m venv <your-env>
source <your-env>/bin/activate
<your-env>/bin/pip install /path/to/librarypython3 -m venv <your-env>
<your-env>\Scripts\activate
<your-env>\Scripts\pip.exe install \path\to\libraryThis library uses the standard Python logging functionality to log some RPC events that could be of interest for debugging and monitoring purposes. Note the following:
To enable logging for this library without any changes in your code, set the GOOGLE_SDK_PYTHON_LOGGING_SCOPE environment variable to a valid Google logging scope. This configures handling of logging events (at level logging.DEBUG or higher) from this library in a default manner, emitting the logged messages in a structured format. It does not currently allow customizing the logging levels captured nor the handlers, formatters, etc. used for any logging event.
A logging scope is a period-separated namespace that begins with google, identifying the Python module or package to log.
NOTE: If the logging scope is invalid, the library does not set up any logging handlers.
export GOOGLE_SDK_PYTHON_LOGGING_SCOPE=googleexport GOOGLE_SDK_PYTHON_LOGGING_SCOPE=google.cloud.library_v1You can also configure a valid logging scope using Python's standard logging mechanism.
import logging
from google.cloud.translate_v3 import translate
base_logger = logging.getLogger("google")
base_logger.addHandler(logging.StreamHandler())
base_logger.setLevel(logging.DEBUG)import logging
from google.cloud.translate_v3 import translate
base_logger = logging.getLogger("google.cloud.library_v1")
base_logger.addHandler(logging.StreamHandler())
base_logger.setLevel(logging.DEBUG)| Back | FazBrowse Home | New Git URL |