Debugging features in Python can be enabled using environment variables. For more information on the available features and how to enable them, see the Debugging API reference.
Unlike other platforms, Python doesn't expose convenience methods to send pings on demand.
In case that is necessary, calling the
submit function for a given ping,
pings.custom_ping.submit(), will send it.
GLEAN_LOG_PINGS environment variable is set to
true, pings are
logged to the console on
DEBUG level whenever they are submitted.
Make sure that when you configure logging in your application, you set the level
for the Python logging library to
DEBUG or higher. Otherwise pings won't be
logged even if
GLEAN_LOG_PINGS is set to
You can set the logging level for the Python logging to
DEBUG as follows:
import logging logging.basicConfig(level=logging.DEBUG)
All log messages from the Glean SDK are on the
glean logger, so if you need to control it independently, you can set a level for just the Glean SDK (but note that the global Python logging level also needs to be set as above):
See the Python logging documentation for more information.