Zxce3 / userbot

Formatted string passed to logging module PYL-W1203
Performance
Minor
a year ago2 years old
Use lazy % formatting in logging functions
69    if failed_modules:
70        logging.warning(f"Failed to import {failed_modules} modules")
71    if failed_handlers:
72        logging.warning(f"Failed to add {failed_handlers} to handlers")73
74    if len(sys.argv) == 4:
75        restart_type = sys.argv[3]
Use lazy % formatting in logging functions
67        f"Imported {success_handlers} handlers from {success_modules} modules."
68    )
69    if failed_modules:
70        logging.warning(f"Failed to import {failed_modules} modules")71    if failed_handlers:
72        logging.warning(f"Failed to add {failed_handlers} to handlers")
73
Use lazy % formatting in logging functions
63        else:
64            success_modules += 1
65
66    logging.info(67        f"Imported {success_handlers} handlers from {success_modules} modules."
68    )
69    if failed_modules:
Use lazy % formatting in logging functions
52                        success_handlers += 1
53                    except Exception as e:
54                        failed_handlers += 1
55                        logging.warning(56                            f"Can't add {module_path}.{name}.{handler.__name__}: {e.__class__.__name__}: {e}"
57                        )
58        except Exception as e:
Use lazy % formatting in logging functions
28            )
29            die()
30    except (errors.NotAcceptable, errors.Unauthorized) as e:
31        logging.error(32            f"{e.__class__.__name__}: {e}\n"
33            f"Get help"
34        )