From 597717601601e841df75bd69bfc415918c362c70 Mon Sep 17 00:00:00 2001 From: Kim Oliver Drechsel Date: Fri, 6 Aug 2021 13:27:36 +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 | 26 ++++++++++++++++++++------ 1 file changed, 20 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index a940553..fcee60e 100644 --- a/README.md +++ b/README.md @@ -1,12 +1,26 @@ # logger -Simple logger function for other scripts +Simple logger function with colored Loglevel for other scripts ## Usage example ```python -try: - from loghandler import logger -except: - # if loghandler.py is located in subdirectory "lib" - from lib.loghandler import logger +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 ``` \ No newline at end of file