[core] Log parameter that were not used after each draw
Whenever a new bar is being drawn, log out all parameters that were not used at all. This might indicate a bug in the module, or might point to a spelling error in the parameter name. fixes #494
This commit is contained in:
parent
a5cfc802ff
commit
2e26f6d0c4
2 changed files with 12 additions and 0 deletions
|
@ -5,10 +5,13 @@
|
|||
import sys
|
||||
import json
|
||||
import uuid
|
||||
import logging
|
||||
|
||||
import bumblebee.store
|
||||
import bumblebee.util
|
||||
|
||||
log = logging.getLogger(__name__)
|
||||
|
||||
def scrollable(func):
|
||||
def wrapper(module, widget):
|
||||
text = func(module, widget)
|
||||
|
@ -178,6 +181,9 @@ class I3BarOutput(object):
|
|||
if self._config and self._config.reverse():
|
||||
widgets = list(reversed(widgets))
|
||||
sys.stdout.write(json.dumps(widgets))
|
||||
if len(self._config.unused_keys()) > 0:
|
||||
for key in self._config.unused_keys():
|
||||
log.warning("unused parameter {} - please check the documentation of the affected module to ensure the parameter exists".format(key))
|
||||
|
||||
def end(self):
|
||||
"""Finalizes output"""
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue