Skip to content

Commit

Permalink
improve utils.es logging stream specificity
Browse files Browse the repository at this point in the history
  • Loading branch information
Jerry committed Sep 21, 2021
1 parent a81a279 commit 748baa1
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions biothings/utils/es.py
Original file line number Diff line number Diff line change
Expand Up @@ -915,20 +915,21 @@ def find(self, filter=None, projection=None, *args, **kwargs):
raise NotImplementedError()

results = []
logger = logging.getLogger(__name__)
for doc in self._read().values():
_doc = dict(traverse(doc)) # dotdict
_doc.update(dict(traverse(doc, True)))
for k, v in (filter or {}).items():
if isinstance(v, dict) and "$exists" in v:
logging.error("Ingored filter: {'%s': %s}", k, v)
logger.error("Ignored filter: {'%s': %s}", k, v)
continue
if _doc.get(k) != v:
break
else: # no break
results.append(_pyobj(doc))

if projection: # used by BuildManager.build_info
logging.error("Ignored projection: %s", projection)
logger.error("Ignored projection: %s", projection)

return results

Expand Down

0 comments on commit 748baa1

Please sign in to comment.