Log function on main