Log to Safari JavaScript Console

71,346

Solution 1

You can use the same console object described in that question. The messages will show up in the console tab.

console.log("hello console");

console.log will work "natively" in Firefox (with Firebug), IE8+, and WebKit browsers (including Safari).

Solution 2

Make sure you have "All" selected in the top right corner of the dev tools.

The top right section of the Safari dev tools If it's set to "Error" then your Safari will only show console.error().

Solution 3

It works just the same in Safari as it does in Chrome and Firefox. By default the developer tools is not turned on, so make sure you go to Preferences -> Advanced -> Show Develop Menu in Menu Bar. Then you can pull up the console with Command+Option+C. (That shortcut obviously assumes Mac, not sure the PC shortcut, but it's in the dropdown as well)

Share:
71,346
adib
Author by

adib

I am an idea-person with the ability to execute — from patents to prototypes to production. I’ve been doing dual-track career since I published my first app in middle school. Technical Articles on Professional Blog. Current Apps Available for Purchase Contact me on Earn. My opinions are my own.

Updated on November 05, 2021

Comments

  • adib
    adib over 2 years

    Is there any way to log to Safari's JavaScript console when running with the built-in JavaScript debugger? I've read the Firefox JavaScript logging question and hoping that there is a simple ("native") way to do it in WebKit/Safari.

    Thanks