1.Fix mainthread is locked; 2.Log can be printed in console.