fix debug mode and change log format