Merge pull request #234 from whjiang/logging

fix #225 enable logging to different streams