boltons
boltons copied to clipboard
Logging boltons
There's a couple pure-python logging tools/utils that I find myself re-implementing often. I wonder if they could be added here:
- A
bindfunction that works like Loguru'sbind()but w/ any logger, and is thread & coroutine safe. - A testing tool like
structlog.testing(orunittest.assertLogsin it's simplest form) that allows you to capture not only log records but also formatted output. - A tool like
contextlib.redirect_stdoutbut that doesn't do it by monkey patching thesysmodule (that's howcontextlib.redirect_stdoutworks) an instead operates at the os file descriptor level (os.dup/os.dup2).