Kim Oliver Drechsel e9ac6de0d0
Some checks failed
continuous-integration/drone/push Build is failing
Merge remote-tracking branch 'origin/master'
2021-12-05 18:13:04 +01:00
2021-12-05 18:12:45 +01:00
2021-08-08 14:22:12 +02:00
2021-08-07 20:25:23 +02:00
2021-10-07 10:58:24 +02:00
2021-12-05 18:12:45 +01:00
2021-10-22 12:25:22 +02:00

logger

Build Status

Simple logger class with colored LogLevel designed to run inside Docker container

Debug can be enabled by setting the environment variable

DEBUG_MODE = True

Usage example

# Usage with os only necessary if environment variable has not been set before (e.g. outside Docker)
import os
os.environ['DEBUG_MODE'] = 'True'

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:36:09] DEBUG [test.py.main:7] This is a Debug Message
[Fri, 06 Aug 2021 13:36:09] INFO [test.py.main:8] This is a Info Message
[Fri, 06 Aug 2021 13:36:09] WARNING [test.py.main:9] This is a Warning Message
[Fri, 06 Aug 2021 13:36:09] ERROR [test.py.main:10] This is a Error Message
[Fri, 06 Aug 2021 13:36:09] CRITICAL [test.py.main:11] This is a Critical Message

Credits

Repo Icon made by Smartline from www.flaticon.com

Description
Simple logger function
Readme
2022-08-13 12:32:52 +02:00
Languages
Python 100%