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.

Source Distribution

python-gcp-injections-1.5.1.tar.gz (7.3 kB view details)

Uploaded Source

File details

Details for the file python-gcp-injections-1.5.1.tar.gz.

File metadata

  • Download URL: python-gcp-injections-1.5.1.tar.gz
  • Upload date:
  • Size: 7.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/2.0.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.38.0 CPython/3.6.0

File hashes

Hashes for python-gcp-injections-1.5.1.tar.gz
Algorithm Hash digest
SHA256 f5e6cdc5fb9c5ef902b4a2c73e05b5ec7699d84111488a3d6727138022dff6df
MD5 87d3f5776316a0ce9fcdc9b18610838a
BLAKE2b-256 d84ada5f68e7bbf9099011a090ebc6ad064e731767341d7801521ce831d2a08e

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page