posix_ipc icon indicating copy to clipboard operation
posix_ipc copied to clipboard

Improve debug mode

Open osvenskan opened this issue 6 years ago • 0 comments

Right now, debug mode (enabling DPRINTF statements) requires a recompile to enable/disable. It'd be nicer if that was available all the time but switched off by default. Ideas for turning on debug statements at runtime include --

  • Different classes (e.g. SemaphoreDebug)
  • Flag passed at init (e.g. sem = Semaphore(..., debug=True))
  • Context manager (e.g. with posix_ipc.DebugMode:)
  • Global on/off flag (e.g. posix_ipc.debug = True)

I also want to consider proper logging instead of always writing to stdout.

Suggestions are welcome. :-)

osvenskan avatar Sep 06 '18 12:09 osvenskan