mirror of
https://github.com/beetbox/beets.git
synced 2026-01-30 20:13:37 +01:00
beets.logging exports NullHandler on python 2.6
NullHandler is not available in python 2.6. We backport it so the importer log can use it for it is more convenient than guarding calls to self.logger (see beets/importer.py)
This commit is contained in:
parent
cce0a5d81f
commit
81754e5760
1 changed files with 13 additions and 0 deletions
|
|
@ -92,3 +92,16 @@ if PY26:
|
|||
return logger
|
||||
|
||||
my_manager.getLogger = new_getLogger
|
||||
|
||||
|
||||
# Offer NullHandler in Python 2.6 to reduce the difference with never versions
|
||||
if PY26:
|
||||
class NullHandler(Handler):
|
||||
def handle(self, record):
|
||||
pass
|
||||
|
||||
def emit(self, record):
|
||||
pass
|
||||
|
||||
def createLock(self):
|
||||
self.lock = None
|
||||
|
|
|
|||
Loading…
Reference in a new issue