Use setdefault rather than explicit check and set

Change-Id: I7a903986209a307eaae658baab409b74970fd2e8
Prefer use of super()

Change-Id: I1d6522fdd0bac31515e970e5cc239d7c542ca322
Explicitly label global variable access

Change-Id: Ie3a8cf21ded30d1fa74e2ccf25e88dd1d084c4b0
Switch from print()int to logging

This makes it much easier to customise where the output ends up,
but for the moment just dump everything to stdout as it was previously.

Change-Id: I2315aa2b980e1a3b17e046a9d85043e6d1f6e4ae
Also log errors from Gerrit.

This is very helpful when trying to debug why it won't connect.

Change-Id: I41e9046389962dc839e1d2bcece16357089b25cf