Skip to main content

Tools and libraries for python to better run services on GCP

Project description

pip install python-gcp-injections

If you want single line logging you can use standard logging with logging.info("This is my log text"). But if you would like to have som more context you use.

from gcpi.stackdriverlog import get_logger
LOG = get_logger()

my_dict_data = {'test':1, 'debug':2}

LOG.info("This is my log")
LOG.info(my_dict_data, param1='true', message="Invoice render timing")

message is the text that will show up as summary in the log. My dict_data in this case will show up under jsonPayload event, while the param1 will show up on the same level as event.

Django

in settings.py add

from gcpi.stackdriverlog import stackdriver_init_logging
stackdriver_init_logging()

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for python-gcp-injections, version 1.5.1
Filename, size File type Python version Upload date Hashes
Filename, size python-gcp-injections-1.5.1.tar.gz (7.3 kB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page