From c8f0cbdd330143c4454b4cda2495d80e9d54c74d Mon Sep 17 00:00:00 2001 From: pks Date: Thu, 22 Dec 2022 10:51:00 +0100 Subject: python examples --- python/logging.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100755 python/logging.py (limited to 'python/logging.py') diff --git a/python/logging.py b/python/logging.py new file mode 100755 index 0000000..84e2134 --- /dev/null +++ b/python/logging.py @@ -0,0 +1,13 @@ +#!/usr/bin/env python3.9 + +import logging +import sys + +logging.basicConfig(stream=sys.stdout) +logger = logging.getLogger() +logger.warning("test") +try: + a = [] + a[1] = 2 +except Exception as e: + logger.exception(e) -- cgit v1.2.3