From 2a26381dedb810b42a1f2b7c79641eb3eb2cf633 Mon Sep 17 00:00:00 2001 From: Kim Oliver Drechsel Date: Fri, 6 Aug 2021 13:40:53 +0200 Subject: [PATCH] =?UTF-8?q?=E2=80=9EREADME.md=E2=80=9C=20=C3=A4ndern?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 24 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index fcee60e..a04e027 100644 --- a/README.md +++ b/README.md @@ -1,11 +1,18 @@ # logger -Simple logger function with colored Loglevel for other scripts +Simple logger function with colored LogLevel for other scripts and designed to run inside Docker container + +Debug can be enabled by setting the environment variable + +*DEBUG_MODE = True* ## Usage example ```python -from loghandler import logger +# 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") @@ -13,14 +20,15 @@ def main(): 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 +[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 + ``` \ No newline at end of file