Replace print with logging (#964)

pull/1048/head
Kota Yamaguchi 2019-11-21 19:42:03 +09:00 committed by Lucas Hosseini
parent da24fcc56e
commit 83a341f300
1 changed files with 7 additions and 3 deletions

View File

@ -16,6 +16,10 @@ import inspect
import pdb
import platform
import subprocess
import logging
logger = logging.getLogger(__name__)
def instruction_set():
@ -35,15 +39,15 @@ def instruction_set():
try:
instr_set = instruction_set()
if instr_set == "AVX2":
print("Loading faiss with AVX2 support.", file=sys.stderr)
logger.info("Loading faiss with AVX2 support.")
from .swigfaiss_avx2 import *
else:
print("Loading faiss.", file=sys.stderr)
logger.info("Loading faiss.")
from .swigfaiss import *
except ImportError:
# we import * so that the symbol X can be accessed as faiss.X
print("Loading faiss.", file=sys.stderr)
logger.error("Loading faiss.")
from .swigfaiss import *