Closed Michael-E-Rose closed 2 weeks ago
Users would enable logging like so:
import logging
logging.getLogger('sosia').setLevel(logging.DEBUG)
This is going to store all all SQLite queries and Scopus queries to a file.
@nils-herrmann Can you please take this over?
It guess it is straightforward, since only few functions are affected. When users activate the DEBUG level, all queries made by sosia should be logged to a file called debug.txt
. Store it in the usual ~/.cache/sosia/
folder. All queries means: all SQLite queries and all Scopus queries. After each query, store the number of results. Make the output such that each block of queries is visually separable from the next.
Here is an overview of the implementation:
sosia/utils/logger.py
.'%(asctime)s - %(levelname)s: %(message)s'
:
2024-10-25 14:44 - INFO - sosia - Stored information for 99,210 sources as well as 241,648 field-source
~/.cache/sosia/sosia.log
.pd.read_sql_query()
In one way or the other, we need to implement logging.
At the very least, it should log which query is beging performed. Another interesting aspect might be to log timings.