Prevent empty objects from appearing in the log

The problem was especially apparent when json: false was set.