Closed MonliH closed 5 years ago
All warning messages are routed through a 'log' class attribute on the Parser class. You can change it to something else using Python's logging module:
import logging
class MyParser(sly.Parser):
log = logging.getLogger('whatever')
The output would then be controlled by logging configuration. To silence it completely, you could use some kind of null-logger or other object for the log.
I found a way to diable the logging. You have to set the level of the logger to ERROR
:
import logging
class MyParser(sly.Parser):
log = logging.getLogger()
log.setLevel(logging.ERROR)
Is there a way to disable the sly warnings? Here is an exmaple of one:
I have tried the ply way to diable (using
NullLogger
) but that doesn't work. Disabling the warnings isn't really documented and I can't find anything online.Any help would be appreciated.