Ensure that there are either loggers or placeholders all the way from the specified logger to the root of the logger hierarchy.
(self, alogger)
| 1411 | self.logRecordFactory = factory |
| 1412 | |
| 1413 | def _fixupParents(self, alogger): |
| 1414 | """ |
| 1415 | Ensure that there are either loggers or placeholders all the way |
| 1416 | from the specified logger to the root of the logger hierarchy. |
| 1417 | """ |
| 1418 | name = alogger.name |
| 1419 | i = name.rfind(".") |
| 1420 | rv = None |
| 1421 | while (i > 0) and not rv: |
| 1422 | substr = name[:i] |
| 1423 | if substr not in self.loggerDict: |
| 1424 | self.loggerDict[substr] = PlaceHolder(alogger) |
| 1425 | else: |
| 1426 | obj = self.loggerDict[substr] |
| 1427 | if isinstance(obj, Logger): |
| 1428 | rv = obj |
| 1429 | else: |
| 1430 | assert isinstance(obj, PlaceHolder) |
| 1431 | obj.append(alogger) |
| 1432 | i = name.rfind(".", 0, i - 1) |
| 1433 | if not rv: |
| 1434 | rv = self.root |
| 1435 | alogger.parent = rv |
| 1436 | |
| 1437 | def _fixupChildren(self, ph, alogger): |
| 1438 | """ |
no test coverage detected