A package to register GCP loggings
Project description
GCP LOGGING MANAGER
This is a simple gcp logging package where you can easily write logs to gcp stackdriver with custom parameters.
GCP Stackdriver matrics
param type: Resource type to filter in Stackdriver Logging (required) param service: Service name to filter in Stackdriver Logging (required) param log_name: Log Name to filter in Stackdriver Logging param region: GCP Service Region to filter in Stackdriver Logging (optional) default value region='us-east1'
Sample code
from santodigital_gcpLogging import CloudRunLoggingClient
# Resouce must match with strackdriver resource.type (cloud_run_revision or bigquery_resource etc)
resource = 'cloud_run_revision'
name = 'santodigital-gcpLogging'
SERVICE = 'santodigital-gcpLogging'
logger = CloudRunLoggingClient(resource, SERVICE, name)
"""
:param struct: (Dict) Custom information for logging into Stackdriver Logging.
:param severity: Severity Level for the logging.
"""
def report(struct, severity='INFO'):
logger.report(struct, severity)
return True
if __name__ == '__main__':
print(report({'info':'success'}, 'WARNING'))
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
Built Distribution
Close
Hashes for santodigital-gcpLogging-0.0.3.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | ade06f6ebf579ec6d0afedc183378dea8a97d9a870974698296e100e6c83a2b2 |
|
MD5 | 793dad254a5d4aa5b53cc5e12dc20a7c |
|
BLAKE2b-256 | faa9c720ba9808d4a88741acaac00ba10f1647cc46c06791956d7bffd348e164 |
Close
Hashes for santodigital_gcpLogging-0.0.3-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | cb57db77cc64e1c50e8a66c6485b50e9be10e01b9c5e81353535247b87f51a55 |
|
MD5 | 152f5b8271b0632382c0dccf9371cd3e |
|
BLAKE2b-256 | 9b5ed22d91015bb2d99b97da6cfe1506eb80a8f2f9e9a25ddb31d48383c1639e |