From 89b769088e8c4f21199c4956e015f407e3f77a78 Mon Sep 17 00:00:00 2001 From: redxef Date: Tue, 14 Nov 2023 15:59:57 +0100 Subject: [PATCH] Add verbose log level. --- adapters/wordpress.py | 1 - main.py | 4 ++++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/adapters/wordpress.py b/adapters/wordpress.py index 1ebb001..60306b9 100644 --- a/adapters/wordpress.py +++ b/adapters/wordpress.py @@ -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( diff --git a/main.py b/main.py index b537b2d..01efb14 100755 --- a/main.py +++ b/main.py @@ -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', '')} ({e.get('start')})" for e in events]) # post events if dryrun: