View Single Post
Old 04-22-2016, 10:22 AM   #1238
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 45,484
Karma: 28005164
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
What logger are we talking about here? IIRC plugin base classes have no default logger defined? If you want to use a DEBUG level dependent logger, the way to do it is like this:

from calibre.utils.logging import ThreadSafeLog

log = ThreadSafeLog(level=ThreadSafeLog.DEBUG if DEBUG else ThreadSafeLog.WARN)


That means that log.info()/log.debug() will be no-ops unless DEBUG is defined.
kovidgoyal is offline   Reply With Quote