Skip to main content

A json log formatter.

Project description

(saga)logger-python

Json logger compatible with logger

Get the code

git clone https://github.com/Sagacify/logger-py

Install

pip install sagalogger

How to setup

>>>>from sagalogger import get_logger
>>>>test = get_logger("test")
>>>>test.warn("ATTENTION")
{"name": "ipython", "data": null, "meta": null, "event": "ATTENTION", "time": "2016-09-02T18:04:40Z", "msg": "", "hostname": "MacBook-Pro-de-Augustin.local", "level": 40, "module": "test", "pid": 96277, "v": 0}

How to use

All logger functions (trace, debug, info, warn, error, fatal) expect 1 -> 3 arguments as follow: - event: Should be a string(not enforced) identifying the event. - data: the data that was used in that piece of the program. - meta: Any meta information that could be of interest.

Developping

To run the tests and watch the sources for any changes, run:

docker-compose up

To run the style-tests, run:

docker-compose run py flake8

To output coverage information in html, run:

docker-compose run py pytest --cov=src --cov-report html:coverage/html

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

sagalogger-0.3.1.tar.gz (4.1 kB view hashes)

Uploaded Source

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page