MCPcopy Index your code
hub / github.com/RustPython/RustPython / getLogger

Method getLogger

Lib/logging/__init__.py:1362–1391  ·  view source on GitHub ↗

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 exist bu

(self, name)

Source from the content-addressed store, hash-verified

1360 self._disable = _checkLevel(value)
1361
1362 def getLogger(self, name):
1363 """
1364 Get a logger with the specified name (channel name), creating it
1365 if it doesn't yet exist. This name is a dot-separated hierarchical
1366 name, such as "a", "a.b", "a.b.c" or similar.
1367
1368 If a PlaceHolder existed for the specified name [i.e. the logger
1369 didn't exist but a child of it did], replace it with the created
1370 logger and fix up the parent/child references which pointed to the
1371 placeholder to now point to the logger.
1372 """
1373 rv = None
1374 if not isinstance(name, str):
1375 raise TypeError('A logger name must be a string')
1376 with _lock:
1377 if name in self.loggerDict:
1378 rv = self.loggerDict[name]
1379 if isinstance(rv, PlaceHolder):
1380 ph = rv
1381 rv = (self.loggerClass or _loggerClass)(name)
1382 rv.manager = self
1383 self.loggerDict[name] = rv
1384 self._fixupChildren(ph, rv)
1385 self._fixupParents(rv)
1386 else:
1387 rv = (self.loggerClass or _loggerClass)(name)
1388 rv.manager = self
1389 self.loggerDict[name] = rv
1390 self._fixupParents(rv)
1391 return rv
1392
1393 def setLoggerClass(self, klass):
1394 """

Callers 15

log.pyFile · 0.80
_debugFunction · 0.80
_install_loggersFunction · 0.80
configure_loggerMethod · 0.80
configure_rootMethod · 0.80
getChildMethod · 0.80
getLoggerFunction · 0.80
__enter__Method · 0.80
setUpMethod · 0.80
_test_urlsMethod · 0.80

Calls 3

_fixupChildrenMethod · 0.95
_fixupParentsMethod · 0.95
isinstanceFunction · 0.85

Tested by 15

setUpMethod · 0.64
_test_urlsMethod · 0.64
tearDownModuleFunction · 0.64
_caplogFunction · 0.64
test_levelMethod · 0.64
setUpMethod · 0.64
tearDownMethod · 0.64
test_flatMethod · 0.64
test_nested_explicitMethod · 0.64
test_nested_inheritedMethod · 0.64