Skip to content
This repository was archived by the owner on Sep 8, 2024. It is now read-only.

Commit b7786d4

Browse files
authored
Merge pull request #2359 from MycroftAI/bugfix/test-logger-restore
Make skill's logging visible in tester
2 parents bf92014 + af79c7c commit b7786d4

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

test/integrationtests/skills/skill_tester.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@
4545
from mycroft.skills.settings import Settings
4646
from mycroft.skills.skill_loader import SkillLoader
4747
from mycroft.configuration import Configuration
48+
from mycroft.util.log import LOG
4849

4950
from logging import StreamHandler
5051
from io import StringIO
@@ -143,6 +144,11 @@ def load_skills(emitter, skills_root):
143144
skill_loader.skill_id = skill_id
144145
skill_loader.load()
145146
skill_list.append(skill_loader.instance)
147+
148+
# Restore skill logger since it was created with the temporary handler
149+
if skill_loader.instance:
150+
skill_loader.instance.log = LOG.create_logger(
151+
skill_loader.instance.name)
146152
log[path] = buf.getvalue()
147153

148154
return skill_list, log

0 commit comments

Comments
 (0)