add log feature for debug.