SMS Log handler
This is a python sms handler. The idea is to quickly alert the developer that something has gone horribly wrong with their application. This only serves as a means of alerting, for comprehensive traceback you can configure something like Sentry or use python’s SMTPHandler to get email alerts.
Requirements
Python 3.4+
The handler has not been tested using python27. Feel free to open a pull request if you need support for this version
Installation
pip install sms-log-handler
Python
The following details how this handler can be configured to run on Python. The implementation below is specific to AfricasTalking Provider
import logging
LOGGER = logging.getLogger(__name__)
provider_config = {
'provider_class': 'sms_log_handler.providers.africastalking.AfricasTalkingProvider',
'provider_key': '<your-username>',
'provider_secret': '<your-api-key>',
'provider_send_to': ['+25472XXXXXXX', ]
}
handler = SMSHandler(provider_config)
LOGGER.addHandler(handler)
try:
raise KeyError()
except:
LOGGER.error('Duplicate records found in the user model', exc_info=True)
Django
To use the logger in django configure your LOGGING to include the SMSHandler as part of you handlers.
# settings.py
LOGGING = {
'version': 1,
'handlers': {
'smshandler': {
'level': 'ERROR',
'class': 'sms_log_handler.sms_handler.SMSHandler',
'provider_config': {
'provider_key': '<your-username>',
'provider_secret': '<your-api-key>',
'provider_send_to': ['+25472XXXXXXX']
}
},
},
'loggers': {
'django': {
'handlers': ['smshandler'],
'propagate': True,
'level': 'ERROR',
},
}
}
Metadata
Release files for sms_log_handler 0.0.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| sms_log_handler-0.0.1.tar.gz | 4.6 kB | Without provenance | Details for sms_log_handler-0.0.1.tar.gz |
Release files / sms_log_handler-0.0.1.tar.gz
| Download URL | sms_log_handler-0.0.1.tar.gz |
|---|---|
| Size | 4.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
10107030760d8c41645761828c901d72e4cf5ed28e07ce2eb5d6b463dd4855c6
|
|
BLAKE2b-256 checksum How to use checksums |
c15b917aeebaee24af111c63a7cb58ad2234dce362e8541e6617faeca845dcb8
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Security for sms_log_handler 0.0.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.