fix #978/reST logging

cc @ralsina @faassen.  Also introduces a `nikola.DEBUG`/`site.debug` variable which is required by the new fix (the contribution guidelines are happy).