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.

Files for zentuxlog-client, version 1.0.3
Filename, size File type Python version Upload date Hashes
Filename, size zentuxlog-client-1.0.3.tar.gz (5.2 kB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page