This is a simple logging tool to help devs focus on writing code instead of writing logs.
Project description
EZlogR for Python!
Overview
Project info at Pypi
This module helps developers focus on writing code and less time worrying about writing logs.
How it works
EZlogR gives a standardized way for developers to write logs, and creates these logs in JSON format. JSON is easily digestable by a multitude of programs and databases. This lets the developer have the option to easily pull the logs into something like MongoDB, a JSON viewing tool, or still be easily human readable due to the simplified and flat nature of the JSON packing.
Compatibility
This version of EZlogR is compatible with Python3.6 and later.
Installation
Install EZlogR using pip or pip3:
pip install ezlogr
or
pip3 install ezlogr
Usage
Here is a simple python file that shows EZlogR in action.
Filename: simple_sample.py
#!/usr/bin/env python3
#Step 1: Import ezlogr
import ezlogr
#Step 2: Set some tags
tags = ["Very cool app", "non-prod"]
#Step 3: Set the filename for your logs. (This will automatically append .log to the .py filename like this: 'myfile.py.log')
filename = __file__
#Step 4: Make your logger instance.
logger = ezlogr.Ezlogr(filename=filename, tags=tags)
#Step 5: Now write your code with EZlogR!
import time
logger.info("Here I go writin' logs!")
time.sleep(1)
logger.info("I'm doing it again!")
Output
After using EZlogR, you will see logs like this:
Filename: simple_sample.py.log
{'filename': '/Users/jeremy/simple_sample.py', 'log_level': 'info', 'hrtimestamp': 'Wed Jun 17 10:07:23 2020', 'datestamp': '17062020', 'timestamp': '100723.921712', 'log_msg': "Here I go writin' logs!", 'tags': '["Very cool app", "non-prod"]'}
{'filename': '/Users/jeremy/simple_sample.py', 'log_level': 'info', 'hrtimestamp': 'Wed Jun 17 10:07:24 2020', 'datestamp': '17062020', 'timestamp': '100724.926889', 'log_msg': "I'm doing it again!", 'tags': '["Very cool app", "non-prod"]'}
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
Built Distribution
Hashes for EZlogR-0.1.0.dev2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 324c3e58dc0f3a7cf52d183c7f8b5056e3ba810f43c47902cf956f56a2ad33a5 |
|
MD5 | e07391ab6c9bb4d213dd1458c76d47ca |
|
BLAKE2b-256 | 1bedad37c5058c50d29919ffe42c6eeedc1fba253cb89336a3317607be5480a3 |