'Fully stop logging and close log file.
In order to start logging again, a new logstart() call needs to be
made, possibly (though not necessarily) with a new filename, mode and
other options.'

def logstop(self):

    if (self.logfile is not None):
        self.logfile.close()
        self.logfile = None
    else:
        print "Logging    hadn't    been    started."
    self.log_active = False
