def _plugin_error_handler(package):
    f = failure.Failure()
    f.trap(ImportError)

    log_func = logger.error

    # set the logger to info when running unit tests in order to avoid flooding
    if util.in_unittest():
        log_func = logger.info

    log_func('Failed loading plugins from package %r: %s(%s)' % (package.__name__, f.type.__name__, f.getErrorMessage()))
dataset/ETHPy150Open foundit/Piped/piped/plugin.py/_plugin_error_handler/original