Adds the logfile

The construct "with", which creates a so-called context, can be very useful. One can e.g. define a class Saver which has __enter__ and __exit__ methods which are used by "with". This means one can do arbitrarily complex operations, such as setting up data in an object, recording log info, recording what changed while in the context, or whatever, when entering "with" and exiting the code block.

Whenever you use a "transaction begin", "transaction commit" kind of operation in your source code, considering wrapping it in a context class, and things will be done automatically. No forgetting to do the commit anymore.