Skip to main content

Sonde / Client API ZentuxLog

Project description

pipeline status coverage report

Utilisation

Dans un script, une classe, un module, ...

from zentuxlog_client.client import Client

APIKEY = "hkhfds56dfsdfjhdjk"
APISECRET = "KAP0dika43iH7"
USERNAME = "John"
PASSWORD = "Mypass

auth = {
            'client_id': APIKEY,
            'client_secret': APISECRET,
            'username': USERNAME,
            'password': PASSWORD
        }
c = Client(auth=auth)
c.send(data="information à logguer", method="POST", path="logs/")

Dans une exception personnalisée

from zentuxlog_client.client import Client

APIKEY = "hkhfds56dfsdfjhdjk"
APISECRET = "KAP0dika43iH7"
USERNAME = "John"
PASSWORD = "Mypass"
auth = {
            'client_id': APIKEY,
            'client_secret': APISECRET,
            'username': USERNAME,
            'password': PASSWORD
        }
c = Client(auth=auth)

class MyCustomError(Exception):
    """Erreur générique."""
    def __init__(self, msg=''):
        self.msg = msg
        if msg:
            c.send(msg, method="POST", path="logs/")

    def __str__(self):
        return self.msg

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

zentuxlog-client-1.0.3.tar.gz (5.2 kB view details)

Uploaded Source

File details

Details for the file zentuxlog-client-1.0.3.tar.gz.

File metadata

  • Download URL: zentuxlog-client-1.0.3.tar.gz
  • Upload date:
  • Size: 5.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.0.0 requests-toolbelt/0.9.1 tqdm/4.43.0 CPython/3.7.7

File hashes

Hashes for zentuxlog-client-1.0.3.tar.gz
Algorithm Hash digest
SHA256 a5ce88945c0823193d0f3ad089112fcbbfa00f32aa4bb3fccaf5b35566cbae86
MD5 d1cf2dafd8a37af334277db856a2852d
BLAKE2b-256 e78958a58e298e65fbc633ccb75e7146aa95ae339f8d97497558018f7b59c20d

See more details on using hashes here.

Supported by

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