Check tagName in logger.js

Don't blow up if elem doesn't have tagName. (i.e. `{ el: document }`)