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
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a5ce88945c0823193d0f3ad089112fcbbfa00f32aa4bb3fccaf5b35566cbae86
|
|
| MD5 |
d1cf2dafd8a37af334277db856a2852d
|
|
| BLAKE2b-256 |
e78958a58e298e65fbc633ccb75e7146aa95ae339f8d97497558018f7b59c20d
|