fossasia / open-event-server

Lazy formatting of message string passed to logging module PYL-W1202
Performance
Minor
5 months agoa year old
Use lazy % formatting in logging functions
658        logging.exception('Error while charging omise')
659    if charge.failure_code is not None:
660        logging.warning(
661            "Omise Failure Message: {} ({})".format(662                charge.failure_message, charge.failure_code
663            )
664        )
Use lazy % formatting in logging functions
316        )
317    except (requests.exceptions.HTTPError, requests.exceptions.InvalidURL):
318        logging.exception(
319            'Error encountered while generating resized images for event with id: {}'.format(320                speaker_id
321            )
322        )
Use lazy % formatting in logging functions
302    speaker = Speaker.query.get(speaker_id)
303    try:
304        logging.info(
305            'Speaker image resizing tasks started for speaker with id {}'.format(306                speaker_id
307            )
308        )
Use lazy % formatting in logging functions
275        logging.info(f'Resized images saved successfully for user with id: {user_id}')
276    except (requests.exceptions.HTTPError, requests.exceptions.InvalidURL):
277        logging.exception(
278            'Error encountered while generating resized images for user with id: {}'.format(279                user_id
280            )
281        )
Use lazy % formatting in logging functions
252        logging.info(f'Resized images saved successfully for group with id: {group_id}')
253    except (requests.exceptions.HTTPError, requests.exceptions.InvalidURL, OSError):
254        logging.exception(
255            'Error encountered while generating resized images for group with id: {}'.format(256                group_id
257            )
258        )