Make some objects "private"
Improve log messages in patch_module.
Add a LogCapture context manager.
Make assertLogged/has more flexible.
Fix getting log level number.
Add support for InstanceTypes.