Sonde / Client API ZentuxLog
Project description
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
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
zentuxlog-client-1.0.1.tar.gz
(5.2 kB
view hashes)