I use Firebug\'s console.log() for debugging my website. If I try viewing my website in browsers without Firebug then I get a console is not defined er
Honestly, I'd use that. It not only covers console.log()
, but also every other console
method, and in a decently short number of lines. The fact that it was first used in the Yahoo media player seems to suggest that it works excellently cross-browser, as well.
That bit of code is your best bet, is actually decently elegant, and should work in most every case. As long as you comment above the snippet just what it is for (so as not to confuse future developers), you should be fine.