Closed xxyzz closed 3 months ago
I missed this, but I wonder if we need to set a logging level for the wikitextprocessor logger from inside wiktextract? Does INFO get a higher precedence than DEBUG, so INFO and WARNING will get through?
info is higher than debug: https://docs.python.org/3/library/logging.html#logging-levels so set level to debug enables info, default level is probably warning.
I think we're current use logging as printf
and our default level is debug, so don't combine two packages' logger is simpler. Maybe we could consider how to use the logging library later if we don't want two separate log methods...
I meant that we might have to modify wikitextprocessor's logger's level, like we do with other loggers. It is correct to have two different loggers for wiktextract and wikitextprocessor, because they're two packages.
I'll pass the --verbose
bool command option to Wtp.__init__
, and set the logger debug level if it's False
so we'll have the save level in two packages.
I added an extra not
and wiktextract uses the --quiet
option to set the debug log level.
Our previous code use the root logger configed in wiktextract code, but now wiktextract doesn't use root logger thus all info level logs are not printed.