Add verbose log level.

This commit is contained in:
redxef 2023-11-14 15:59:57 +01:00
parent 437ad585ac
commit 89b769088e
Signed by: redxef
GPG key ID: 7DAC3AA211CBD921
2 changed files with 4 additions and 1 deletions

View file

@ -161,7 +161,6 @@ class Wordpress(Sink, Adapter):
return nonce['value']
def post_events(self, events, start: datetime.datetime | None=None, until: datetime.timedelta | None=None):
metadata = self.calendar_metadata.to_dict()
data = self._generate_data(events, start=start, until=until)
update_request = self.session.post(

View file

@ -13,6 +13,8 @@ import click
import adapters
from adapters import *
logging.VERBOSE = (logging.DEBUG + logging.INFO) // 2
logger = logging.getLogger(f'wp_cal')
def range_str_to_timedelta(value):
@ -78,6 +80,7 @@ def set_logging_level(level: str):
levels = {
'NOTSET': logging.NOTSET,
'DEBUG': logging.DEBUG,
'VERBOSE': logging.VERBOSE,
'INFO': logging.INFO,
'WARNING': logging.WARNING,
'WARN': logging.WARNING,
@ -161,6 +164,7 @@ def main(config, dryrun, level, range):
logger.info('not syncing cancelled events')
events = [e for e in events if e['status'] != 'cancelled']
logger.info('syncing %d events', len(events))
logger.log(logging.VERBOSE, 'events are: %s', [f"{e.get('summary', '<NO SUMMARY PROVIDED>')} ({e.get('start')})" for e in events])
# post events
if dryrun: