Restores logging of console calls to the STDOUT
authortimothy@apple.com <timothy@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 21 May 2008 18:16:46 +0000 (18:16 +0000)
committertimothy@apple.com <timothy@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 21 May 2008 18:16:46 +0000 (18:16 +0000)
commit73ad21df7c23052962acdb771536b0359d02c763
tree9828b25226b96d6f2a64d7fc1aca6cb715a430cf
parent063efa97064435bb2c0ff5a1c7db9563c57b7796
Restores logging of console calls to the STDOUT
when Interpreter::shouldPrintExceptions() is true.

<rdar://problem/5636442> REGRESSION: Console.log no longer logs to
the system console or terminal

<rdar://problem/5146079> JavaScript exception logging should print
accurate file and line info when called from WebScriptObject

Reviewed by Adam Roben.

* bindings/js/JSCustomSQLStatementCallback.cpp:
(WebCore::JSCustomSQLStatementCallback::handleEvent): Remove existing
printf and check for Interpreter::shouldPrintExceptions() since there is
a call to Console::addMessage.
* bindings/js/JSCustomSQLStatementErrorCallback.cpp:
(WebCore::JSCustomSQLStatementErrorCallback::handleEvent): Ditto.
* bindings/js/JSCustomSQLTransactionCallback.cpp:
(WebCore::JSCustomSQLTransactionCallback::handleEvent): Ditto.
* bindings/js/JSCustomSQLTransactionErrorCallback.cpp:
(WebCore::JSCustomSQLTransactionErrorCallback::handleEvent): Ditto.
* bindings/js/JSCustomVoidCallback.cpp:
(WebCore::JSCustomVoidCallback::handleEvent): Ditto.
* bindings/js/JSCustomXPathNSResolver.cpp:
(WebCore::JSCustomXPathNSResolver::lookupNamespaceURI): Ditto.
* bindings/js/JSDOMWindowBase.cpp:
(WebCore::JSDOMWindowBase::printErrorMessage): Ditto.
* bindings/js/ScheduledAction.cpp:
(WebCore::ScheduledAction::execute): Ditto.
* bindings/js/kjs_events.cpp:
(WebCore::JSAbstractEventListener::handleEvent): Ditto.
* loader/FrameLoader.cpp:
(WebCore::FrameLoader::shouldAllowNavigation): Ditto.
* bindings/objc/WebScriptObject.mm:
(WebCore::addExceptionToConsole): Added helper static function that
calls Console::addMessage.
(-[WebScriptObject callWebScriptMethod:withArguments:]): Call addExceptionToConsole.
(-[WebScriptObject evaluateWebScript:]): Ditto.
(-[WebScriptObject setValue:forKey:]): Ditto.
(-[WebScriptObject valueForKey:]): Ditto.
(-[WebScriptObject removeWebScriptKey:]): Ditto.
(-[WebScriptObject webScriptValueAtIndex:]): Ditto.
(-[WebScriptObject setWebScriptValueAtIndex:value:]): Ditto.
* page/Console.cpp:
(WebCore::Console::addMessage): Print the level, message,
URL and line number to STDOUT.
(WebCore::printToStandardOut): Helper static function that
takes a prefix string, ExecState, an argument List and URL.
Prints the prefix and loops through the arguments calling
toString on each and printing the string. Finally printing
the URL and new line.
(WebCore::Console::error): Call printToStandardOut.
(WebCore::Console::info): Ditto.
(WebCore::Console::log): Ditto.
(WebCore::Console::assertCondition): Ditto.
(WebCore::Console::warn): Ditto.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@33970 268f45cc-cd09-0410-ab3c-d52691b4dbfc
13 files changed:
WebCore/ChangeLog
WebCore/bindings/js/JSCustomSQLStatementCallback.cpp
WebCore/bindings/js/JSCustomSQLStatementErrorCallback.cpp
WebCore/bindings/js/JSCustomSQLTransactionCallback.cpp
WebCore/bindings/js/JSCustomSQLTransactionErrorCallback.cpp
WebCore/bindings/js/JSCustomVoidCallback.cpp
WebCore/bindings/js/JSCustomXPathNSResolver.cpp
WebCore/bindings/js/JSDOMWindowBase.cpp
WebCore/bindings/js/ScheduledAction.cpp
WebCore/bindings/js/kjs_events.cpp
WebCore/bindings/objc/WebScriptObject.mm
WebCore/loader/FrameLoader.cpp
WebCore/page/Console.cpp