def log_to(logger):
    """
    Wraps a function that has a connection passed such that everything that
    happens on the connection is logged using the given logger.

    :type  logger: Logger
    :param logger: The logger that handles the logging.
    """
    logger_id = id(logger)

    def decorator(function):
        func = add_label(function, 'log_to', logger_id=logger_id)
        return func
    return decorator
Wraps a function that has a connection passed such that everything that
    happens on the connection is logged using the given logger.

    :type  logger: Logger
    :param logger: The logger that handles the logging.