def log_upgrade_finished(content, event):
    detail = "from %s to %s (%s)" % (
        event.from_version, event.to_version,
        event.success and 'success' or 'failure')
    event = LoggingEvent('upgrade finished', content, detail)
    event.enable()
    event.log()
def log_upgrade_start(content, event):
    # Disable logging during upgrade
    detail = "from %s to %s" % (event.from_version, event.to_version)
    event = LoggingEvent('upgrade start', content, detail)
    event.log()
    event.disable()