add log
replace some printf to LOG_DEBUG. Then we can use macro to hide debug information.