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 hashes)
Built Distribution
Close
Hashes for statuscope-0.0.5-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 56e31ddb07df196a6515aaf8437ccef5e683af57319c543a944a4ac2fe778957 |
|
MD5 | 59f8b5d79e4bb39669a261ea31aaf171 |
|
BLAKE2b-256 | 9ef3139cc0bd1a0f8623ddf1a4bc56d8102f6efee7dc8e3df9569551ad8ae4f0 |