Return a logger with the specified name, creating if necessary. if patch_makeRecord, the logger makeRecord will be replaced with a PEP3101 compatible version.
(name, add_NullHandler=True, patch_makeRecord=True)
| 58 | |
| 59 | |
| 60 | def get_logger(name, add_NullHandler=True, patch_makeRecord=True): |
| 61 | """Return a logger with the specified name, creating if necessary. |
| 62 | |
| 63 | if patch_makeRecord, the logger makeRecord will be replaced with a PEP3101 compatible version. |
| 64 | """ |
| 65 | logger = logging.getLogger(name) |
| 66 | if add_NullHandler: |
| 67 | logger.addHandler(logging.NullHandler()) |
| 68 | if patch_makeRecord: |
| 69 | logger.makeRecord = _makeRecord |
| 70 | return logger |
| 71 | |
| 72 | LOGGER = get_logger('lantz') |
| 73 |
no outgoing calls