Closed xxyzz closed 3 months ago
Perhaps we should consider use Python's logging
library in wikitextprocessor? It could print error messages to error output and save logs to a file so we don't need to worry logs take too much memory. And we also might use other features from logging
.
Let's introduce new imports only when necessary. Wikitextprocessor has worked well without logging up till now, and we have our own error logging system. If there is a pressing need to print logging stuff and no way to do it, then it should be done, but not prematurely.
The main problem with our current Wtp.error()
methods is they save data in memory not how they are printed, and the recent check JSON code adds more JSON data to the log messages which exacerbates the problem. The server currently has enough RAM but IMO this could be improved.
Logger
obejct in wiktextract code and won't affect other packages: tatuylonen/wiktextract#591