Commit e5e8c448 authored by Inductiveload's avatar Inductiveload
Browse files

WS-stat: improve logging

parent 8df992c8
......@@ -25,6 +25,8 @@ def sql_all_revs_for_index_pages_since(conn, index_id, since):
if not since:
since = 19700101000000
logging.info(f"Getting revisions on index {index_id} since {since}")
cursor = conn.cursor(dictionary=True)
sql = """
......@@ -39,8 +41,12 @@ ORDER BY p.page_id
;"""
cursor.execute(sql, (104, index_id, since))
# print(cursor.statement)
return cursor.fetchall()
logging.debug(cursor.statement)
revs = cursor.fetchall()
logging.info(f"Got {len(revs)} revisions")
return revs
def connect_db(host, db):
......@@ -261,8 +267,8 @@ ON DUPLICATE KEY UPDATE
if only_since_last:
last_update = self.get_last_index_update(index.pageid)
else:
last_update = None
last_update = None
myresult = sql_all_revs_for_index_pages_since(
self.mw_conn, index.pageid, last_update)
......@@ -349,6 +355,11 @@ def main():
log_level = logging.DEBUG if args.verbose else logging.INFO
logging.basicConfig(level=log_level)
logging.getLogger("urllib3").setLevel(logging.WARNING)
logging.getLogger("oauthlib").setLevel(logging.WARNING)
logging.getLogger("requests").setLevel(logging.WARNING)
logging.getLogger("requests_oauthlib").setLevel(logging.WARNING)
pwbl = logging.getLogger("pywiki")
pwbl.disabled = True
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment