log success messages and errors in loader.py (#1683)
log success messages and errors in loader.py (#1683)

Summary:
This patch is to provide log information in case of failing to load the AVX2-enabled lib,
and also to log the successful loading of the libraries.

Otherwise, the programmatic detection of which library was loaded also needs to take
into account which other log statements were executed, if the original import failed due to an exception,
cf. the tests in https://github.com/conda-forge/faiss-split-feedstock/pull/27

Finally, this reduces the number of import statements by one - one non-AVX2 fallback is enough.

Related to https://github.com/facebookresearch/faiss/issues/1600, https://github.com/facebookresearch/faiss/issues/1680, https://github.com/facebookresearch/faiss/issues/1681, https://github.com/facebookresearch/faiss/issues/1682.

Pull Request resolved: https://github.com/facebookresearch/faiss/pull/1683

Reviewed By: mdouze

Differential Revision: D26424333

Pulled By: beauby

fbshipit-source-id: 16beddec7e0c098b913a7f5420cbb02d1cf515ad

facebookresearch/faiss,facebookresearch/faiss,facebookresearch/faiss,facebookresearch/faiss