View Single Post
Old 04-19-2016, 02:46 AM   #2
davidfor
Grand Sorcerer
davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.
 
Posts: 24,905
Karma: 47303824
Join Date: Jul 2011
Location: Sydney, Australia
Device: Kobo:Touch,Glo, AuraH2O, GloHD,AuraONE, ClaraHD, Libra H2O; tolinoepos
I have also had some broken pipe errors reported on Macs recently. Most I tracked down to print statements I had left in the code. Kovid has checked in a change that hopefully will fix this.

In any case, use:

Code:
from calibre.constants import DEBUG
"DEBUG" will be true if calibre is in debug mode.

I also tend to use a function called "debug_print". That adds a time to the log and only prints in debug mode. This is defined in calibre/devices/usbms/driver.py but I will sometimes copy it locally so I can customise if for the plugin.
davidfor is offline   Reply With Quote