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.3.tar.gz
(8.1 kB
view hashes)
Built Distribution
Close
Hashes for streply_sdk-0.0.3-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | fecb1131e8d3febc47ce62330355290a3cd24febf3f4d1a4d8737c74767868c3 |
|
MD5 | 7797a79f882844e7a406852aa9b5afc6 |
|
BLAKE2b-256 | 49c1ef04faebfbe46aa186b3d502b4a66bf81a20f5ebbd2d045f0f303cf6efec |