Log console messages to NSLog (so we can see them in Console.app)

This commit is contained in:
Corey Johnson 2012-09-20 15:26:26 -07:00
parent d3443ad2f1
commit 5b9a305bba
3 changed files with 6 additions and 2 deletions

View File

@ -95,11 +95,10 @@ bool AtomCefClient::OnConsoleMessage(CefRefPtr<CefBrowser> browser,
const CefString& source,
int line) {
REQUIRE_UI_THREAD();
std::cout << std::string(message) << "\n";
Log(message.ToString().c_str());
return true;
}
bool AtomCefClient::OnKeyEvent(CefRefPtr<CefBrowser> browser,
const CefKeyEvent& event,
CefEventHandle os_event) {

View File

@ -111,6 +111,7 @@ class AtomCefClient : public CefClient,
void ShowSaveDialog(int replyId, CefRefPtr<CefBrowser> browser);
CefRefPtr<CefListValue> CreateReplyDescriptor(int replyId, int callbackIndex);
void Exit(int status);
void Log(const char *message);
IMPLEMENT_REFCOUNTING(AtomCefClient);
IMPLEMENT_LOCKING(AtomCefClient);

View File

@ -92,3 +92,7 @@ CefRefPtr<CefListValue> AtomCefClient::CreateReplyDescriptor(int replyId, int ca
void AtomCefClient::Exit(int status) {
exit(status);
}
void AtomCefClient::Log(const char *message) {
NSLog(@"%s", message);
}