Capture log messages for the given modules and archive
    them to a ``LogFile`` resource.

def capture(package, prefix, modules=[], level=logging.DEBUG):
    """ Capture log messages for the given modules and archive
    them to a ``LogFile`` resource. """
    handler = LogFileHandler(package, prefix)
    formatter = logging.Formatter(FORMAT)
    handler.setFormatter(formatter)
    modules = set(modules + ['loadkit'])

    for logger in modules:
        if not hasattr(logger, 'addHandler'):
            logger = logging.getLogger(logger)
        logger.setLevel(level=level)
        logger.addHandler(handler)

    return handler