add log api
Merge pull request #356 from wenshao/master

add log api