Get a logger with the specified name (channel name), creating it if it doesn't yet exist. This name is a dot-separated hierarchical name, such as "a", "a.b", "a.b.c" or similar. If a PlaceHolder existed for the specified name [i.e. the logger didn't ex
(self, name)
| 1325 | self._disable = _checkLevel(value) |
| 1326 | |
| 1327 | def getLogger(self, name): |
| 1328 | """ |
| 1329 | Get a logger with the specified name (channel name), creating it |
| 1330 | if it doesn't yet exist. This name is a dot-separated hierarchical |
| 1331 | name, such as "a", "a.b", "a.b.c" or similar. |
| 1332 | |
| 1333 | If a PlaceHolder existed for the specified name [i.e. the logger |
| 1334 | didn't exist but a child of it did], replace it with the created |
| 1335 | logger and fix up the parent/child references which pointed to the |
| 1336 | placeholder to now point to the logger. |
| 1337 | """ |
| 1338 | rv = None |
| 1339 | if not isinstance(name, str): |
| 1340 | raise TypeError('A logger name must be a string') |
| 1341 | _acquireLock() |
| 1342 | try: |
| 1343 | if name in self.loggerDict: |
| 1344 | rv = self.loggerDict[name] |
| 1345 | if isinstance(rv, PlaceHolder): |
| 1346 | ph = rv |
| 1347 | rv = (self.loggerClass or _loggerClass)(name) |
| 1348 | rv.manager = self |
| 1349 | self.loggerDict[name] = rv |
| 1350 | self._fixupChildren(ph, rv) |
| 1351 | self._fixupParents(rv) |
| 1352 | else: |
| 1353 | rv = (self.loggerClass or _loggerClass)(name) |
| 1354 | rv.manager = self |
| 1355 | self.loggerDict[name] = rv |
| 1356 | self._fixupParents(rv) |
| 1357 | finally: |
| 1358 | _releaseLock() |
| 1359 | return rv |
| 1360 | |
| 1361 | def setLoggerClass(self, klass): |
| 1362 | """ |