Frame Logging
Your project description goes here
Documentation
The full documentation is at https://frame_logging.readthedocs.io.
Quickstart
Install Frame Logging:
pip install frame_logging
Add it to your INSTALLED_APPS:
INSTALLED_APPS = (
...
'frame_logging.apps.FrameLoggingConfig',
...
)
Create a class to format your extra logging kwargs
#
class FrameFormatterExample(FrameFormatter):
# format methods
@classmethod
def get_format_behaviour(cls):
return OrderedDict([
('customer_id', cls.format_customer_id),
])
@classmethod
def format_customer_id(cls, customer_id):
return "customer_id={}".format(customer_id)
# then if you need to, you can add new method to transform extra kwargs
# transform methods
@classmethod
def get_transform_kwargs_methods(cls):
return {
'order': cls.transform_order,
}
@classmethod
def transform_order(cls, order, **kwargs):
kwargs['customer_id'] = order.customer['id']
return kwargs
Configure frame loggin in your settings.py
# mandatory, if you do not priovide a formatter the app will crash
FRAME_FORMATTER=FrameFormatterExample()
# optionnal, default = ' - '
FRAME_SEPARATOR='+'
Use it:
import frame_logging.log as log
class Order(object):
def __init__(self):
self.customer = {'id': 1}
log.info('Renewed contract %s', 'test', order=order)
# 'Renewed contract test - customer_id=1'))
Features
TODO
Running Tests
Does the code actually work?
source <YOURVIRTUALENV>/bin/activate (myenv) $ pip install tox (myenv) $ tox
Credits
Tools used in rendering this package:
History
0.1.0 (2017-10-26)
First release on PyPI.
Metadata
Release files for frame_logging 0.2.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 |
|---|---|---|---|---|
| frame_logging-0.2.1.tar.gz | 6.9 kB | Without provenance | Details for frame_logging-0.2.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| frame_logging-0.2.1-py2.py3-none-any.whl | Python 2, Python 3 | none | any | Details for frame_logging-0.2.1-py2.py3-none-any.whl |
Total release size: 14.0 kB
Release files / frame_logging-0.2.1.tar.gz
| Download URL | frame_logging-0.2.1.tar.gz |
|---|---|
| Size | 6.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
7bb97faf0da1535a44dcd6ae29d5a4e91177642b0d673da11904f6ea442ec97f
|
|
BLAKE2b-256 checksum How to use checksums |
4b8be60c1c7aaa8475ee33227c02f472500e739bc5a9bbe60978e70d511de90b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Release files / frame_logging-0.2.1-py2.py3-none-any.whl
| Download URL | frame_logging-0.2.1-py2.py3-none-any.whl |
|---|---|
| Size | 7.1 kB |
| Tags | Python 2 Python 3 |
|
SHA-256 checksum How to use checksums |
69c701e8862be9d9977cfe9eefa7020795791360605ad7906fe7389c65f5a3ae
|
|
BLAKE2b-256 checksum How to use checksums |
387d43e6a00e443e0595609562a7dcf689450371ae0d76a2fdc15d8723a7c3fe
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Security for frame_logging 0.2.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.