Add logging to Undefined type.

This is almost the same as mitsuhiko/flask#1028 although it does not check if we are running in debug mode.