patch from Stefano Ricci to fix debug for logger