logger.py/README.md

26 lines
702 B
Markdown
Raw Normal View History

2021-08-06 11:15:47 +02:00
# logger
2021-08-06 13:27:36 +02:00
Simple logger function with colored Loglevel for other scripts
2021-08-06 11:18:42 +02:00
## Usage example
```python
2021-08-06 13:27:36 +02:00
from loghandler import logger
def main():
logger.debug("This is a Debug Message")
logger.info("This is a Info Message")
logger.warning("This is a Warning Message")
logger.error("This is a Error Message")
logger.critical("This is a Critical Message")
main()
```
```
[Fri, 06 Aug 2021 13:20:41] INFO [test.py.main:6] This is a Info Message
[Fri, 06 Aug 2021 13:20:41] WARNING [test.py.main:7] This is a Warning Message
[Fri, 06 Aug 2021 13:20:41] ERROR [test.py.main:8] This is a Error Message
[Fri, 06 Aug 2021 13:20:41] CRITICAL [test.py.main:9] This is a Critical Message
2021-08-06 11:18:42 +02:00
```