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 na
(self, suffix)
| 1754 | return is_enabled |
| 1755 | |
| 1756 | def getChild(self, suffix): |
| 1757 | """ |
| 1758 | Get a logger which is a descendant to this one. |
| 1759 | |
| 1760 | This is a convenience method, such that |
| 1761 | |
| 1762 | logging.getLogger('abc').getChild('def.ghi') |
| 1763 | |
| 1764 | is the same as |
| 1765 | |
| 1766 | logging.getLogger('abc.def.ghi') |
| 1767 | |
| 1768 | It's useful, for example, when the parent logger is named using |
| 1769 | __name__ rather than a literal string. |
| 1770 | """ |
| 1771 | if self.root is not self: |
| 1772 | suffix = '.'.join((self.name, suffix)) |
| 1773 | return self.manager.getLogger(suffix) |
| 1774 | |
| 1775 | def __repr__(self): |
| 1776 | level = getLevelName(self.getEffectiveLevel()) |