Only peek at the node type for logging.

This prevents "Trying to reassign node type" exceptions. Logging should
never affect the data being logged.

This is in #242 but we should get it into 2.0. Reviwe by @cvogt