add log and rewrite debug
Merge branch 'master' into gh-pages