def notify(transitions, logger):
    """
    A generator taking a sequence of alarm transitions, logs them, and then re-yields them:

        transitions = notify( a.compute(), logging.info )
        for trans in transitions:
            ...
    """
    for trans in transitions:
        logger(trans.message())
        yield trans
