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 hashes)

Uploaded Source

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