We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents a2b764f + 6e8bc9a commit a1411fdCopy full SHA for a1411fd
1 file changed
web/server/codechecker_server/migrations/logging.py
@@ -63,7 +63,10 @@ def setup_logger(schema: str):
63
logger = logging.getLogger(f"migration/{schema}")
64
logging.setLoggerClass(existing_logger_cls)
65
66
- if not logger.hasHandlers():
+ # logger.hasHandlers() falls back on parent's handlers, however,
67
+ # logger.handlers contains the immediate handlers only. It is important to
68
+ # check this list directly otherwise list indexing fails on "else" branch.
69
+ if not logger.handlers:
70
fmt = MigrationFormatter(schema)
71
handler = logging.StreamHandler()
72
handler.setFormatter(fmt)
0 commit comments