From 949d46c51707aabffb15b1d02a93068ab071aefe Mon Sep 17 00:00:00 2001 From: Mads Hvelplund Date: Fri, 10 Jan 2025 09:55:45 +0100 Subject: [PATCH] List Python loggers --- docs/Programming/Python.md | 11 +++++++++++ docs/index.md | 2 +- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/docs/Programming/Python.md b/docs/Programming/Python.md index e112999..cb54863 100644 --- a/docs/Programming/Python.md +++ b/docs/Programming/Python.md @@ -1,6 +1,17 @@ # Python +## List the loggers and make some of them shut up + +```python +# List loggers +loggers = [logging.getLogger(name) for name in logging.root.manager.loggerDict] +print(loggers) + +# STFU Py4J +logging.getLogger("py4j.clientserver").setLevel(logging.ERROR) +``` + ## Decorative Python Primer on Python Decorators: diff --git a/docs/index.md b/docs/index.md index fbf8fc8..a84f7f1 100644 --- a/docs/index.md +++ b/docs/index.md @@ -6,12 +6,12 @@ slay the same dragon twice. ## Notes +- (2025-10-01) [Python](./Programming/Python.md) - (2024-12-18) [Jupyter](./Programming/Jupyter.md) - (2024-10-21) [Git](./Miscellaneous/Git.md) - (2024-10-15) [CLI tools](./DevOps/CLI.md) - (2024-08-07) [Shell scripting](./DevOps/BashScripting.md) - (2024-08-07) [Node.js & TypeScript](./Programming/Node.md) -- (2024-06-21) [Python](./Programming/Python.md) - (2024-05-31) [OAuth2](./Miscellaneous/OAuth2.md) - (2024-03-21) [Kubernetes](./Miscellaneous/Kubernetes.md) - (2024-01-25) [OpenSSL/Certificates](./Miscellaneous/Certificates.md)