Skip to main content

MoonHub.ai logging manager to push logs into GCP Cloud Logging

Project description

Moonhub Logger

Use the mh_logger package

1. Install

python3 -m pip install mh_logger

2. Import and use

from mh_logger import LoggingManager
logger = LoggingManager(__name__)
logger.info("This is a sample log", hello="world")

Output:

2023-03-16 20:22:36,561 [INFO] - TestLogger: this is a sample log - JSON Payload: {'hello': 'world'}

Set following environment variable if you want to push logs to GCP Cloud Logging service while testing locally.

GCP_SERVICE_KEY=google-service-key.json

Create and upload the mh_logger package

https://packaging.python.org/en/latest/tutorials/packaging-projects/

You will need to add --skip-existing.

MIT License

Copyright (c) [year] [fullname]

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Project details


Release history Release notifications | RSS feed

Download files

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

Source Distribution

mh-logger-0.0.37.tar.gz (6.3 kB view details)

Uploaded Source

Built Distribution

mh_logger-0.0.37-py3-none-any.whl (6.5 kB view details)

Uploaded Python 3

File details

Details for the file mh-logger-0.0.37.tar.gz.

File metadata

  • Download URL: mh-logger-0.0.37.tar.gz
  • Upload date:
  • Size: 6.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.6

File hashes

Hashes for mh-logger-0.0.37.tar.gz
Algorithm Hash digest
SHA256 ed6d6d9f08cb50e99f6fcb73920637582a0ea4603df912fedcebcaaf8f275626
MD5 9a5080293f5c9f0aa03d397637fab762
BLAKE2b-256 79eafd48ee7aa0b99e11a44b9a50e79fc8e0a6a173330920656fa2f0ffd4b0bb

See more details on using hashes here.

File details

Details for the file mh_logger-0.0.37-py3-none-any.whl.

File metadata

  • Download URL: mh_logger-0.0.37-py3-none-any.whl
  • Upload date:
  • Size: 6.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.6

File hashes

Hashes for mh_logger-0.0.37-py3-none-any.whl
Algorithm Hash digest
SHA256 82366b4ad74a1c7945c19b3791c9b3e5fdcdb5af19e24b6ba6717cac1b32c2a4
MD5 772731432ea95a2f23f9620276bdf928
BLAKE2b-256 629e37afd62ca35a1a28670e6f3886571cf6e30b3879bab1e8147bce451d77df

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