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

watch() raises KeyError #45

Open
Henddher opened this issue Dec 31, 2018 · 2 comments · Fixed by nilp0inter/experta#2
Open

watch() raises KeyError #45

Henddher opened this issue Dec 31, 2018 · 2 comments · Fixed by nilp0inter/experta#2

Comments

@Henddher
Copy link

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)>

@nilp0inter
Copy link
Contributor

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')

@Henddher
Copy link
Author

Thanks @nilp0inter

That worked 👍

Feel free to close this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants