Use log instead of print for debug.