A python package which, as implied by it's name, does two things. Logs(function execution along with the arguments passed) and catch(es) a potential exception. It is a name combination of two things people love. (Chocolate)logs and cats.
The original goal, was to get rid of some boilerplate code, because I noticed "too many functions" in my statistical sample, follow the pattern:
- Enter function body
- Log stuff
- Catch potential exceptions
Also, this could help prettifying your code, as a result
pip install catslog
You might need to use pip3
and/or sudo
, depending on your setup.
I.e
sudo pip3 install catslog
# First import the package
from catslog import catslog
# Then, decorate a target function
@catslog
def cats_me_if_you_can(*args, **kwargs):
# Moar code
Unfortunately no. I have developed it and tested it, only with python3. But if you have done it, please check the next section. I am more than happy to hear from you.
Thats great, thank you in advance for your efforts. Feel free to raise a pull request and I will have a look asap.
Pretty simple. First build the package:
python setup.py bdist_wheel
and then install the local build
pip install -e .