pyknow
pyknow copied to clipboard
watch() raises KeyError
STEPS TO REPRODUCE:
Using https://github.com/buguroo/pyknow/blob/develop/docs/examples/maximum.ipynb
watch(watchers.RULES, watchers.FACTS, watchers.ACTIVATIONS)
m.run()
---------------------------------------------------------------------------
KeyError Traceback (most recent call last)
<ipython-input-4-b1cd45e85340> in <module>
----> 1 watch(watchers.RULES, watchers.FACTS, watchers.ACTIVATIONS)
2 m.run()
~/Documents/github/pyknow/pyknow/pyknow/watchers.py in watch(level, *what)
39
40 for watcher_name in what:
---> 41 watcher = globals()[watcher_name]
42 watcher.setLevel(level)
43
KeyError: <Logger pyknow.watchers.RULES (WARNING)>
The comment in that notebook is wrong. Sorry about that.
watch
receives strings with the names of the loggers to watch. Please, try:
watch('RULES', 'FACTS', 'ACTIVATIONS')
Thanks @nilp0inter
That worked 👍
Feel free to close this issue.