Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update logging so global voc resources don't appear as errors in the log #126

Merged
merged 1 commit into from Jun 1, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
10 changes: 5 additions & 5 deletions mycroft/skills/mycroft_skill/mycroft_skill.py
Expand Up @@ -900,7 +900,9 @@ def voc_match(self, utt, voc_filename, lang=None, exact=False):
if not voc: # Check for vocab in mycroft core resources
voc = resolve_resource_file(join('text', lang,
voc_filename + '.voc'))

if voc:
LOG.info(f"Found global resource: '{voc_filename}'"
f"for lang '{lang}'")
if not voc or not exists(voc):
raise FileNotFoundError(f'Could not find {voc_filename}.voc file')
# load vocab and flatten into a simple list
Expand Down Expand Up @@ -1057,10 +1059,8 @@ def find_resource(self, res_name, res_dirname=None, lang=None):
result = self._find_resource(res_name, lang, res_dirname)
if not result:
# when resource not found try fallback to en-us
LOG.warning(
f"Skill {self.skill_id} resource '{res_name}' for lang '{lang}' not "
f"found"
)
LOG.info(f"Skill {self.skill_id} resource '{res_name}' for lang "
f"'{lang}' not found in skill")
return result

def _find_resource(self, res_name, lang, res_dirname=None):
Expand Down