IE8 compatibility, only log to console if console is defined