boltons icon indicating copy to clipboard operation
boltons copied to clipboard

Logging boltons

Open adriangb opened this issue 4 years ago • 0 comments

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 bind function that works like Loguru's bind() but w/ any logger, and is thread & coroutine safe.
  • A testing tool like structlog.testing (or unittest.assertLogs in it's simplest form) that allows you to capture not only log records but also formatted output.
  • A tool like contextlib.redirect_stdout but that doesn't do it by monkey patching the sys module (that's how contextlib.redirect_stdout works) an instead operates at the os file descriptor level (os.dup/os.dup2).

adriangb avatar Sep 12 '21 17:09 adriangb