<br><br>
<a href="https://github.com/SwiftyBeaver/SwiftyBeaver">Swift Version</a> |
<a href="http://docs.swiftybeaver.com">Docs</a> |
<a href="https://swiftybeaver.com">Website</a> |
<a href="https://slack.swiftybeaver.com">Slack</a> |
<a href="https://twitter.com/SwiftyBeaver">Twitter</a> |
<a href="https://github.com/SwiftyBeaver/SwiftyBeaver/blob/master/LICENSE">License</a>
<br/>
</p>
<p align="center">
[](https://www.python.org) [](https://slack.swiftybeaver.com)
<p>
----
Conveniently log to the SwiftyBeaver Platform using the built-in Python logging library.
## Installation
Simply install SwiftyBeaver using `pip`:
```sh
$ pip install swiftybeaver
```
Or use `setup.py` after downloading it manually:
```sh
$ python setup.py install
```
## Usage
SwiftyBeaver can be used just as any other Python logging handler:
```python
import logging
from swiftybeaver import SwiftyBeaverHandler
sb_handler = SwiftyBeaverHandler('hThdK', 'sdfa...s3mx', 'dsgb...ghdX')
log = logging.Logger(__name__)
log.addHandler(sb_handler)
log.verbose("not so important") // prio 1, VERBOSE in silver
log.debug("something to debug") // prio 2, DEBUG in green
log.info("a nice information") // prio 3, INFO in blue
log.warning("oh no, that won’t be good") // prio 4, WARNING in yellow
log.error("ouch, an error did occur!") // prio 5, ERROR in red
```
This logging handler sends logging events to the SwiftyBeaver Platform, which allows for viewing logs in it's OS X app and consuming via API. To learn more about SwiftyBeaver, visit the [main repository](https://github.com/SwiftyBeaver/SwiftyBeaver) and the [website](https://swiftybeaver.com).
```python
SwiftyBeaverHandler(app_id, app_secret, encryption_key, device=device)
```
In order to successfully authenticate with the API, `app_id` and `app_secret` have to be provided during initialization. Additionally, `encryption_key` - the key used to encrypt the log entries - is required. `device` is an optional `dict` that should conform to the specification at http://docs.swiftybeaver.com/article/18-sending-logs-via-api. If it is omitted, a mock device will be used.
Please note that logs are transferred AES256CBC-encrypted and, unless configured otherwise, not after every log event. Each log record is associated with a certain number of points, depending on the log level. Log records will then be sent if the collected points are at least `minimum_threshold`. This system is in playe in order to prevent to many API calls during a short time.
## Testing
Run SwiftyBeaver unit tests using `setup.py`:
```sh
$ python setup.py test
```
## General Documentation
**Getting Started:**
- [Features](http://docs.swiftybeaver.com/article/7-introduction)
- [Installation](http://docs.swiftybeaver.com/article/5-installation)
- [Basic Setup](http://docs.swiftybeaver.com/article/6-basic-setup)
**Logging Destinations:**
- [Colored Logging to Xcode Console](http://docs.swiftybeaver.com/article/9-log-to-xcode-console)
- [Colored Logging to File](http://docs.swiftybeaver.com/article/10-log-to-file)
- [Encrypted Logging & Analytics to SwiftyBeaver Platform](http://docs.swiftybeaver.com/article/11-log-to-swiftybeaver-platform)
**Stay Informed:**
- [Official Website](https://swiftybeaver.com)
- [Medium Blog](https://medium.com/swiftybeaver-blog)
- [On Twitter](https://twitter.com/SwiftyBeaver)
More destination & system documentation is coming soon!
Get support via Github Issues, email and [public Slack channel](https://slack.swiftybeaver.com).
## License
SwiftyBeaver for Python is released under the [MIT License](https://github.com/SwiftyBeaver/SwiftyBeaver/blob/master/LICENSE).
Metadata
Release files for SwiftyBeaver 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 |
|---|---|---|---|---|
| SwiftyBeaver-0.1.tar.gz | 7.2 kB | Without provenance | Details for SwiftyBeaver-0.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| SwiftyBeaver-0.1-py2.py3-none-any.whl | Python 2, Python 3 | none | any | Details for SwiftyBeaver-0.1-py2.py3-none-any.whl |
Total release size: 19.0 kB
Release files / SwiftyBeaver-0.1.tar.gz
| Download URL | SwiftyBeaver-0.1.tar.gz |
|---|---|
| Size | 7.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
2d5f81367cd3528211028a84f4d4379524bbbb09d68166328876595e0c617334
|
|
BLAKE2b-256 checksum How to use checksums |
7008517135e9ebe7420a88621b2c0139ef9d84934b6b749802560d1b78c1e5ea
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Release files / SwiftyBeaver-0.1-py2.py3-none-any.whl
| Download URL | SwiftyBeaver-0.1-py2.py3-none-any.whl |
|---|---|
| Size | 11.9 kB |
| Tags | Python 2 Python 3 |
|
SHA-256 checksum How to use checksums |
201b2dc46b5dbbc9d6daf8158d68757453281653358818026db6feea27e354cf
|
|
BLAKE2b-256 checksum How to use checksums |
2cc9baabdd316c1a9f6ec153a13b59b33e871b808e3c811a72addad64137709c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Security for SwiftyBeaver 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.