MCPcopy Create free account
hub / github.com/RT-Thread/env-windows / getLogger

Method getLogger

tools/python-3.11.9-amd64/Lib/logging/__init__.py:1327–1359  ·  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 ex

(self, name)

Source from the content-addressed store, hash-verified

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 """

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
__init__Method · 0.80
mainFunction · 0.80
__init__Method · 0.80
__init__Method · 0.80
load_grammarFunction · 0.80

Calls 4

_fixupChildrenMethod · 0.95
_fixupParentsMethod · 0.95
_acquireLockFunction · 0.85
_releaseLockFunction · 0.85

Tested by 1