sosia-dev / sosia

Sosia: Automatic author matching in Scopus on-line
https://sosia.readthedocs.io/
MIT License
11 stars 3 forks source link

Implement logging #14

Closed Michael-E-Rose closed 2 weeks ago

Michael-E-Rose commented 5 years ago

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.

Michael-E-Rose commented 2 months 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.

Michael-E-Rose commented 1 month ago

@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.

nils-herrmann commented 1 month ago

Here is an overview of the implementation: