Skip to content

Commit

Permalink
List Python loggers
Browse files Browse the repository at this point in the history
  • Loading branch information
mhvelplund authored Jan 10, 2025
1 parent fc9e0e3 commit 949d46c
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
11 changes: 11 additions & 0 deletions docs/Programming/Python.md
Original file line number Diff line number Diff line change
@@ -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: <https://realpython.com/primer-on-python-decorators/>
Expand Down
2 changes: 1 addition & 1 deletion docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 949d46c

Please sign in to comment.