diff --git a/FCHost/fchost/fchost_handler.cc b/FCHost/fchost/fchost_handler.cc index 33586d050ea421cf7836d55437b380041bd1a8bb..15ac430a32b15a0002c9546ec9d396e0e50678ab 100644 --- a/FCHost/fchost/fchost_handler.cc +++ b/FCHost/fchost/fchost_handler.cc @@ -4,6 +4,7 @@ #include "fchost_handler.h" +#include <iostream> #include <sstream> #include <string> #include <fstream> @@ -73,7 +74,13 @@ bool FCHostHandler::OnConsoleMessage(CefRefPtr<CefBrowser> browser, cef_log_seve const CefString& message, const CefString& source, int line) { std::ofstream s("console.log", std::ios_base::app); - s << DateTime() << " - " << source.c_str() << ":" << line << ": " << message.c_str() << "\n"; + s << DateTime() << " - "; + if (source.c_str()) { + s << source.c_str(); + } else { + s << "Unknown Source"; + } + s << ":" << line << ": " << message.c_str() << "\n"; s.flush(); s.close();