A simple method decorator to generate logs easily.
Project description
LoggingDecorator
A simple way to log your Python methods.
About
LoggingDecorator is a MIT licensed general-purpose software package written in Python that simplyfies the task of logging methods of other Python scripts.
Getting Started
To install this package you can just type in your Python terminal:
pip install logging-decorator
Prerequisites
This Python package only works with Python 3.6
or later.
Usage
The simplest use case is logging a generic method and displaying the log on screen.
from LoggingDecorator import logd
@logd
def foo():
print('foo method')
def main():
foo()
if __name__ == '__main__'
main()
Features
- Generate
.log
files inside alog
folder in the current working directory.
from LoggingDecorator import logd
@logd(file=True)
def foo():
print('foo method')
def main():
foo()
if __name__ == '__main__'
main()
- Continue running the script if an exeception is raised:
from LoggingDecorator import logd
@logd(raise_exception=False)
def foo():
print('foo method')
def main():
foo()
if __name__ == '__main__'
main()
Authors
- @lkellermann - Idea & Initial work
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
Close
Hashes for logging_decorator-1.0.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 049ca1cd1c736aa5a5460a5611fa634fd310ee5beaab2100ca6192da030ab68f |
|
MD5 | dddb75e07f5a55d1de9ffd7eb35a2438 |
|
BLAKE2b-256 | 7ab8c20c902666a4dabb9af4db90f49947e1d15ac46357bcacf4392e738132c3 |