MCPcopy Index your code
hub / github.com/python/cpython / getChild

Method getChild

Lib/logging/__init__.py:1787–1804  ·  view source on GitHub ↗

Get a logger which is a descendant to this one. This is a convenience method, such that logging.getLogger('abc').getChild('def.ghi') is the same as logging.getLogger('abc.def.ghi') It's useful, for example, when the parent logger is named using

(self, suffix)

Source from the content-addressed store, hash-verified

1785 return is_enabled
1786
1787 def getChild(self, suffix):
1788 """
1789 Get a logger which is a descendant to this one.
1790
1791 This is a convenience method, such that
1792
1793 logging.getLogger('abc').getChild('def.ghi')
1794
1795 is the same as
1796
1797 logging.getLogger('abc.def.ghi')
1798
1799 It's useful, for example, when the parent logger is named using
1800 __name__ rather than a literal string.
1801 """
1802 if self.root is not self:
1803 suffix = '.'.join((self.name, suffix))
1804 return self.manager.getLogger(suffix)
1805
1806 def getChildren(self):
1807

Callers 1

test_child_loggersMethod · 0.80

Calls 2

getLoggerMethod · 0.80
joinMethod · 0.45

Tested by 1

test_child_loggersMethod · 0.64