Log correctly when msg or err are objects