The all-in-one monitoring app for smart devs (https://streply.com)
Project description
Official Streply SDK for Python
Getting started
Install
pip install --upgrade streply-sdk
Initialization
from streply.streply import streply
streply('https://clientPublicKey@api.streply.com/projectId', {
'environment': 'local',
'release': 'my-project-name@2.3.12',
})
Usage
from streply.capture import exception
# handled exception
try:
raise NotImplementedError("Not implemented error")
except Exception as e:
exception(e)
# Streply will also capture unhandled exception
raise ValueError("Sorry, no numbers below zero")
Exception with error level:
from streply.capture import exception
from streply.enum.level import level
try:
raise NotImplementedError("Not implemented error")
except Exception as e:
exception(e, {}, level.CRITICAL)
Logs
from streply.utils import logger
logger.debug("A debug message")
logger.info("An info message")
logger.warning("A warning message")
logger.error("An error message")
logger.critical("A critical message")
Adding params to log:
from streply.utils import logger
logger.info("A info message", {
'userName': 'Joey'
})
Activity
from streply.capture import activity
activity('auth.register', {
'userName': 'Joey'
})
Configuration
Adding user data
from streply.streply import streply
streply = streply('https://clientPublicKey@api.streply.com/projectId')
streply.set_user('ID')
# or with username
streply.set_user('ID', 'Joey')
or with parameters and name
from streply.streply import streply
streply = streply('https://clientPublicKey@api.streply.com/projectId')
streply.set_user('ID', 'Joey', {
'createdAt': '2022-11-10 15:10:32'
})
Capture levels
level.CRITICAL
level.HIGH
level.NORMAL
level.LOW
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
streply_sdk-0.0.1.tar.gz
(7.6 kB
view hashes)