A package to ease log sending to Statuscope
Project description
python-package
Source code of the Python package that is on PyPI
Install & Update
sudo pip3 install --upgrade statuscope
Example
Here is a sample use of the package.
import argparse
import time
import sys
from statuscope.logger import Logger
if __name__ == '__main__':
parser = argparse.ArgumentParser(description='Sends logs to Statuscope.io')
parser.add_argument('-t',
'--token',
help='API token or task-specific token',
required=True)
parser.add_argument('-i',
'--task_id',
help='Task ID',
required=True)
args = parser.parse_args()
log_sender = Logger(args.token, args.task_id)
log_sender.daemon = True
log_sender.start()
counter = 0
while True:
counter = counter + 1
try:
time.sleep(1)
log_sender.add_log("Here is a log %s" % counter)
except KeyboardInterrupt:
print("Ctrl-C received, exiting...")
sys.exit()
Then to update a log task,
python3 test.py --token cfa0d2ed --task_id QbZJjD2u3uzFvTYAM
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
statuscope-0.0.5.tar.gz
(2.6 kB
view details)
Built Distribution
File details
Details for the file statuscope-0.0.5.tar.gz
.
File metadata
- Download URL: statuscope-0.0.5.tar.gz
- Upload date:
- Size: 2.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.12.1 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.6.3 requests-toolbelt/0.8.0 tqdm/4.29.1 CPython/3.6.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0a09f47b397c5e230fd27af20827497cd5797304193f802eeba12cb0896a4460 |
|
MD5 | 1e20f6c66c0bcfbd3ec59f2ee1dfdd7e |
|
BLAKE2b-256 | 29795d2c4e5a753309ab8e8b9456911672876ae0fd3c1836757e1cee5c3e72c5 |
File details
Details for the file statuscope-0.0.5-py3-none-any.whl
.
File metadata
- Download URL: statuscope-0.0.5-py3-none-any.whl
- Upload date:
- Size: 4.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.12.1 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.6.3 requests-toolbelt/0.8.0 tqdm/4.29.1 CPython/3.6.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 56e31ddb07df196a6515aaf8437ccef5e683af57319c543a944a4ac2fe778957 |
|
MD5 | 59f8b5d79e4bb39669a261ea31aaf171 |
|
BLAKE2b-256 | 9ef3139cc0bd1a0f8623ddf1a4bc56d8102f6efee7dc8e3df9569551ad8ae4f0 |