From a925b941c640289ffd967cab457ab804de69399a Mon Sep 17 00:00:00 2001 From: Stefan Radomski Date: Thu, 27 Apr 2017 09:27:08 +0200 Subject: Added explicit newline to most logs --- apps/uscxml-browser.cpp | 4 +- apps/uscxml-transform.cpp | 4 +- src/uscxml/Interpreter.cpp | 10 ++-- src/uscxml/debug/DebugSession.cpp | 2 +- src/uscxml/interpreter/BasicContentExecutor.cpp | 4 +- src/uscxml/interpreter/FastMicroStep.cpp | 24 ++++----- src/uscxml/plugins/datamodel/lua/LuaDataModel.cpp | 2 +- .../plugins/invoker/dirmon/DirMonInvoker.cpp | 10 ++-- src/uscxml/server/HTTPServer.cpp | 20 +++---- src/uscxml/util/URL.cpp | 62 +++++++++++----------- test/src/test-serialization.cpp | 2 +- test/src/test-snippets.cpp | 2 +- test/src/test-stress.cpp | 2 +- 13 files changed, 74 insertions(+), 74 deletions(-) diff --git a/apps/uscxml-browser.cpp b/apps/uscxml-browser.cpp index cf6e874..f1017bd 100644 --- a/apps/uscxml-browser.cpp +++ b/apps/uscxml-browser.cpp @@ -57,7 +57,7 @@ int main(int argc, char** argv) { // InterpreterOptions* currOptions = options.interpreters[0].second; std::string documentURL = options.interpreters[0].first; - LOGD(USCXML_INFO) << "Processing " << documentURL; + LOGD(USCXML_INFO) << "Processing " << documentURL << std::endl; try { Interpreter interpreter = Interpreter::fromURL(documentURL); @@ -83,7 +83,7 @@ int main(int argc, char** argv) { interpreters.push_back(interpreter); } else { - LOGD(USCXML_ERROR) << "Cannot create interpreter from " << documentURL; + LOGD(USCXML_ERROR) << "Cannot create interpreter from " << documentURL << std::endl; } } catch (Event e) { LOGD(USCXML_DEBUG) << e << std::endl; diff --git a/apps/uscxml-transform.cpp b/apps/uscxml-transform.cpp index 2b440ff..e99ed68 100644 --- a/apps/uscxml-transform.cpp +++ b/apps/uscxml-transform.cpp @@ -211,7 +211,7 @@ int main(int argc, char** argv) { Interpreter interpreter; try { if (inputFile.size() == 0 || inputFile == "-") { - LOGD(USCXML_INFO) << "Reading SCXML from STDIN"; + LOGD(USCXML_INFO) << "Reading SCXML from STDIN" << std::endl; std::stringstream ss; std::string line; while (std::getline(std::cin, line)) { @@ -254,7 +254,7 @@ int main(int argc, char** argv) { } if (!interpreter) { - LOGD(USCXML_ERROR) << "Cannot create interpreter from " << inputFile; + LOGD(USCXML_ERROR) << "Cannot create interpreter from " << inputFile << std::endl; exit(EXIT_FAILURE); } diff --git a/src/uscxml/Interpreter.cpp b/src/uscxml/Interpreter.cpp index 8b11e33..d21b633 100644 --- a/src/uscxml/Interpreter.cpp +++ b/src/uscxml/Interpreter.cpp @@ -170,13 +170,13 @@ Interpreter Interpreter::fromURL(const std::string& url) { } catch (const XERCESC_NS::SAXParseException& toCatch) { - LOGD(USCXML_ERROR) << X(toCatch.getMessage()); + LOGD(USCXML_ERROR) << X(toCatch.getMessage()) << std::endl; } catch (const XERCESC_NS::RuntimeException& toCatch) { - LOGD(USCXML_ERROR) << X(toCatch.getMessage()); + LOGD(USCXML_ERROR) << X(toCatch.getMessage()) << std::endl; } catch (const XERCESC_NS::XMLException& toCatch) { - LOGD(USCXML_ERROR) << X(toCatch.getMessage()); + LOGD(USCXML_ERROR) << X(toCatch.getMessage()) << std::endl; } catch (const XERCESC_NS::DOMException& toCatch) { - LOGD(USCXML_ERROR) << X(toCatch.getMessage()); + LOGD(USCXML_ERROR) << X(toCatch.getMessage()) << std::endl; } return interpreter; @@ -258,7 +258,7 @@ std::list Interpreter::validate() { static void printNodeSet(Logger& logger, const std::list nodes) { std::string seperator; for (auto nIter = nodes.begin(); nIter != nodes.end(); nIter++) { - LOG(logger, USCXML_VERBATIM) << seperator << (HAS_ATTR(*nIter, kXMLCharId) ? ATTR(*nIter, kXMLCharId) : DOMUtils::xPathForNode(*nIter)); + LOG(logger, USCXML_VERBATIM) << seperator << (HAS_ATTR(*nIter, kXMLCharId) ? ATTR(*nIter, kXMLCharId) : DOMUtils::xPathForNode(*nIter)) << std::endl; seperator = ", "; } } diff --git a/src/uscxml/debug/DebugSession.cpp b/src/uscxml/debug/DebugSession.cpp index 6e2f7ef..802b355 100644 --- a/src/uscxml/debug/DebugSession.cpp +++ b/src/uscxml/debug/DebugSession.cpp @@ -215,7 +215,7 @@ void DebugSession::run(void* instance) { // return; // } } - LOG(INSTANCE->_interpreter.getLogger(), USCXML_DEBUG) << "done"; + LOG(INSTANCE->_interpreter.getLogger(), USCXML_DEBUG) << "done" << std::endl; } Data DebugSession::debugStop(const Data& data) { diff --git a/src/uscxml/interpreter/BasicContentExecutor.cpp b/src/uscxml/interpreter/BasicContentExecutor.cpp index 820a945..f9da79e 100644 --- a/src/uscxml/interpreter/BasicContentExecutor.cpp +++ b/src/uscxml/interpreter/BasicContentExecutor.cpp @@ -144,7 +144,7 @@ void BasicContentExecutor::processSend(XERCESC_NS::DOMElement* element) { } else if (delayAttr.unit.length() == 0) { // unit less delay is interpreted as milliseconds delayMs = strTo(delayAttr.value); } else { - LOG(_callbacks->getLogger(), USCXML_ERROR) << "Cannot make sense of delay value " << delay << ": does not end in 's' or 'ms'"; + LOG(_callbacks->getLogger(), USCXML_ERROR) << "Cannot make sense of delay value " << delay << ": does not end in 's' or 'ms'" << std::endl; } } } catch (Event e) { @@ -370,7 +370,7 @@ void BasicContentExecutor::process(XERCESC_NS::DOMElement* block) { } else if (iequals(tagName, xmlPrefix + "script")) { processScript(block); } else { - LOG(_callbacks->getLogger(), USCXML_ERROR) << tagName; + LOG(_callbacks->getLogger(), USCXML_ERROR) << tagName << std::endl; assert(false); } } catch (ErrorEvent exc) { diff --git a/src/uscxml/interpreter/FastMicroStep.cpp b/src/uscxml/interpreter/FastMicroStep.cpp index b1197d0..4f89e1e 100644 --- a/src/uscxml/interpreter/FastMicroStep.cpp +++ b/src/uscxml/interpreter/FastMicroStep.cpp @@ -363,7 +363,7 @@ void FastMicroStep::init(XERCESC_NS::DOMElement* scxml) { if (withCache && cachedState->compound.find("completion") != cachedState->compound.end()) { boost::dynamic_bitset completion = fromBase64(cachedState->compound["completion"]); if (completion.size() != _states.size()) { - LOG(_callbacks->getLogger(), USCXML_WARN) << "State completion has wrong size: Cache corrupted"; + LOG(_callbacks->getLogger(), USCXML_WARN) << "State completion has wrong size: Cache corrupted" << std::endl; } else { _states[i]->completion = completion; goto COMPLETION_STABLISHED; @@ -470,7 +470,7 @@ COMPLETION_STABLISHED: if (withCache && cachedTrans->compound.find("exitset") != cachedTrans->compound.end()) { boost::dynamic_bitset exitSet = fromBase64(cachedTrans->compound["exitset"]); if (exitSet.size() != _states.size()) { - LOG(_callbacks->getLogger(), USCXML_WARN) << "Transition exit set has wrong size: Cache corrupted"; + LOG(_callbacks->getLogger(), USCXML_WARN) << "Transition exit set has wrong size: Cache corrupted" << std::endl; } else { _transitions[i]->exitSet = exitSet; goto EXIT_SET_ESTABLISHED; @@ -501,7 +501,7 @@ EXIT_SET_ESTABLISHED: if (withCache && cachedTrans->compound.find("conflicts") != cachedTrans->compound.end()) { boost::dynamic_bitset conflicts = fromBase64(cachedTrans->compound["conflicts"]); if (conflicts.size() != _transitions.size()) { - LOG(_callbacks->getLogger(), USCXML_WARN) << "Transition conflicts has wrong size: Cache corrupted"; + LOG(_callbacks->getLogger(), USCXML_WARN) << "Transition conflicts has wrong size: Cache corrupted" << std::endl; } else { _transitions[i]->conflicts = conflicts; goto CONFLICTS_ESTABLISHED; @@ -531,7 +531,7 @@ CONFLICTS_ESTABLISHED: if (withCache && cachedTrans->compound.find("target") != cachedTrans->compound.end()) { boost::dynamic_bitset target = fromBase64(cachedTrans->compound["target"]); if (target.size() != _states.size()) { - LOG(_callbacks->getLogger(), USCXML_WARN) << "Transition target set has wrong size: Cache corrupted"; + LOG(_callbacks->getLogger(), USCXML_WARN) << "Transition target set has wrong size: Cache corrupted" << std::endl; } else { _transitions[i]->target = target; goto TARGET_SET_ESTABLISHED; @@ -1282,14 +1282,14 @@ bool FastMicroStep::hasLegalConfiguration() { DOMElement* state = *sIter; if (isMember(state, config)) { if (foundScxmlChild) { - LOG(USCXML_ERROR) << "Invalid configuration: Multiple childs of scxml root are active '" << ATTR_CAST(foundScxmlChild, "id") << "' and '" << ATTR_CAST(scxmlChilds[i], "id") << "'"; + LOG(USCXML_ERROR) << "Invalid configuration: Multiple childs of scxml root are active '" << ATTR_CAST(foundScxmlChild, "id") << "' and '" << ATTR_CAST(scxmlChilds[i], "id") << "'" << std::endl; return false; } foundScxmlChild = scxmlChilds[i]; } } if (!foundScxmlChild) { - LOG(USCXML_ERROR) << "Invalid configuration: No childs of scxml root are active"; + LOG(USCXML_ERROR) << "Invalid configuration: No childs of scxml root are active" << std::endl; return false; } @@ -1303,14 +1303,14 @@ bool FastMicroStep::hasLegalConfiguration() { } } if (!foundAtomicState) { - LOG(USCXML_ERROR) << "Invalid configuration: No atomic state is active"; + LOG(USCXML_ERROR) << "Invalid configuration: No atomic state is active" << std::endl; return false; } // the configuration contains no history pseudo-states for (size_t i = 0; i < config.size(); i++) { if (isHistory(Element(config[i]))) { - LOG(USCXML_ERROR) << "Invalid configuration: history state " << ATTR_CAST(config[i], "id") << " is active"; + LOG(USCXML_ERROR) << "Invalid configuration: history state " << ATTR_CAST(config[i], "id") << " is active" << std::endl; return false; } } @@ -1326,7 +1326,7 @@ bool FastMicroStep::hasLegalConfiguration() { (iequals(LOCALNAME(parent), "state") || iequals(LOCALNAME(parent), "parallel"))) { if (!isMember(parent, config)) { - LOG(USCXML_ERROR) << "Invalid configuration: atomic state '" << ATTR_CAST(config[i], "id") << "' is active, but parent '" << ATTR_CAST(parent, "id") << "' is not"; + LOG(USCXML_ERROR) << "Invalid configuration: atomic state '" << ATTR_CAST(config[i], "id") << "' is active, but parent '" << ATTR_CAST(parent, "id") << "' is not" << std::endl; return false; } } @@ -1346,14 +1346,14 @@ bool FastMicroStep::hasLegalConfiguration() { if (isMember(childs[j], config)) { if (foundChildState) { LOG(USCXML_ERROR) << "Invalid configuration: Multiple childs of compound '" << ATTR_CAST(config[i], "id") - << "' are active '" << ATTR_CAST(foundChildState, "id") << "' and '" << ATTR_CAST(childs[j], "id") << "'"; + << "' are active '" << ATTR_CAST(foundChildState, "id") << "' and '" << ATTR_CAST(childs[j], "id") << "'" << std::endl; return false; } foundChildState = childs[j]; } } if (!foundChildState) { - LOG(USCXML_ERROR) << "Invalid configuration: No childs of compound '" << ATTR_CAST(config[i], "id") << "' are active"; + LOG(USCXML_ERROR) << "Invalid configuration: No childs of compound '" << ATTR_CAST(config[i], "id") << "' are active" << std::endl; return false; } } @@ -1365,7 +1365,7 @@ bool FastMicroStep::hasLegalConfiguration() { NodeSet childs = getChildStates(config[i]); for (size_t j = 0; j < childs.size(); j++) { if (!isMember(childs[j], config) && !isHistory(Element(childs[j]))) { - LOG(USCXML_ERROR) << "Invalid configuration: Not all children of parallel '" << ATTR_CAST(config[i], "id") << "' are active i.e. '" << ATTR_CAST(childs[j], "id") << "' is not"; + LOG(USCXML_ERROR) << "Invalid configuration: Not all children of parallel '" << ATTR_CAST(config[i], "id") << "' are active i.e. '" << ATTR_CAST(childs[j], "id") << "' is not" << std::endl; return false; } } diff --git a/src/uscxml/plugins/datamodel/lua/LuaDataModel.cpp b/src/uscxml/plugins/datamodel/lua/LuaDataModel.cpp index 33255db..2071d39 100644 --- a/src/uscxml/plugins/datamodel/lua/LuaDataModel.cpp +++ b/src/uscxml/plugins/datamodel/lua/LuaDataModel.cpp @@ -227,7 +227,7 @@ std::shared_ptr LuaDataModel::create(DataModelCallbacks* callback } } } catch (luabridge::LuaException e) { - LOG(dm->_callbacks->getLogger(), USCXML_INFO) << e.what(); + LOG(dm->_callbacks->getLogger(), USCXML_INFO) << e.what() << std::endl; } luabridge::getGlobalNamespace(dm->_luaState).beginClass("DataModel").endClass(); diff --git a/src/uscxml/plugins/invoker/dirmon/DirMonInvoker.cpp b/src/uscxml/plugins/invoker/dirmon/DirMonInvoker.cpp index e9cf702..32de35c 100644 --- a/src/uscxml/plugins/invoker/dirmon/DirMonInvoker.cpp +++ b/src/uscxml/plugins/invoker/dirmon/DirMonInvoker.cpp @@ -98,7 +98,7 @@ void DirMonInvoker::eventFromSCXML(const Event& event) { void DirMonInvoker::invoke(const std::string& source, const Event& req) { if (req.params.find("dir") == req.params.end()) { - LOG(_callbacks->getLogger(), USCXML_ERROR) << "No dir param given"; + LOG(_callbacks->getLogger(), USCXML_ERROR) << "No dir param given" << std::endl; return; } @@ -136,7 +136,7 @@ void DirMonInvoker::invoke(const std::string& source, const Event& req) { URL url = URL::resolve(dirIter->second.atom, _callbacks->getBaseURL()); if (!url.isAbsolute()) { - LOG(_callbacks->getLogger(), USCXML_ERROR) << "Given directory '" << dirIter->second << "' cannot be transformed to absolute path"; + LOG(_callbacks->getLogger(), USCXML_ERROR) << "Given directory '" << dirIter->second << "' cannot be transformed to absolute path" << std::endl; } else { _dir = url.path(); } @@ -313,7 +313,7 @@ void DirectoryWatch::updateEntries(bool reportAsExisting) { // stat directory for modification date struct stat dirStat; if (stat((_dir + _relDir).c_str(), &dirStat) != 0) { - LOG(_logger, USCXML_ERROR) << "Error with stat on directory " << _dir << ": " << strerror(errno); + LOG(_logger, USCXML_ERROR) << "Error with stat on directory " << _dir << ": " << strerror(errno) << std::endl; return; } @@ -327,7 +327,7 @@ void DirectoryWatch::updateEntries(bool reportAsExisting) { DIR *dp; dp = opendir((_dir + _relDir).c_str()); if (dp == NULL) { - LOG(_logger, USCXML_ERROR) << "Error opening directory " << _dir + _relDir << ": " << strerror(errno); + LOG(_logger, USCXML_ERROR) << "Error opening directory " << _dir + _relDir << ": " << strerror(errno) << std::endl; return; } // iterate all entries and see what changed @@ -352,7 +352,7 @@ void DirectoryWatch::updateEntries(bool reportAsExisting) { struct stat fileStat; if (stat(filename.c_str(), &fileStat) != 0) { - LOG(_logger, USCXML_ERROR) << "Error with stat on directory entry: " << filename << ": " << strerror(errno); + LOG(_logger, USCXML_ERROR) << "Error with stat on directory entry: " << filename << ": " << strerror(errno) << std::endl; continue; } diff --git a/src/uscxml/server/HTTPServer.cpp b/src/uscxml/server/HTTPServer.cpp index 66c9a43..e1ac6bc 100644 --- a/src/uscxml/server/HTTPServer.cpp +++ b/src/uscxml/server/HTTPServer.cpp @@ -92,9 +92,9 @@ HTTPServer::HTTPServer(unsigned short port, unsigned short wsPort, SSLConfig* ss if (_port > 0) { _httpHandle = evhttp_bind_socket_with_handle(_http, NULL, _port); if (_httpHandle) { - LOGD(USCXML_INFO) << "HTTP server listening on tcp/" << _port; + LOGD(USCXML_INFO) << "HTTP server listening on tcp/" << _port << std::endl;; } else { - LOGD(USCXML_ERROR) << "HTTP server cannot bind to tcp/" << _port; + LOGD(USCXML_ERROR) << "HTTP server cannot bind to tcp/" << _port << std::endl; } } @@ -102,9 +102,9 @@ HTTPServer::HTTPServer(unsigned short port, unsigned short wsPort, SSLConfig* ss if (_wsPort > 0) { _wsHandle = evws_bind_socket(_evws, _wsPort); if (_wsHandle) { - LOGD(USCXML_INFO) << "WebSocket server listening on tcp/" << _wsPort; + LOGD(USCXML_INFO) << "WebSocket server listening on tcp/" << _wsPort << std::endl; } else { - LOGD(USCXML_ERROR) << "WebSocket server cannot bind to tcp/" << _wsPort; + LOGD(USCXML_ERROR) << "WebSocket server cannot bind to tcp/" << _wsPort << std::endl; } } @@ -145,9 +145,9 @@ HTTPServer::HTTPServer(unsigned short port, unsigned short wsPort, SSLConfig* ss if (_sslPort > 0) { _sslHandle = evhttp_bind_socket_with_handle(_https, INADDR_ANY, _sslPort); if (_sslHandle) { - LOG(USCXML_INFO) << "HTTPS server listening on tcp/" << _wsPort; + LOG(USCXML_INFO) << "HTTPS server listening on tcp/" << _wsPort << std::endl; } else { - LOG(USCXML_ERROR) << "HTTPS server cannot bind to tcp/" << _wsPort; + LOG(USCXML_ERROR) << "HTTPS server cannot bind to tcp/" << _wsPort << std::endl; } } @@ -461,7 +461,7 @@ void HTTPServer::processByMatchingServlet(const Request& request) { matchesIter++; } - LOGD(USCXML_INFO) << "Got an HTTP request at " << actualPath << " but no servlet is registered there or at a prefix"; + LOGD(USCXML_INFO) << "Got an HTTP request at " << actualPath << " but no servlet is registered there or at a prefix" << std::endl; evhttp_send_error(request.evhttpReq, 404, NULL); } @@ -504,7 +504,7 @@ void HTTPServer::replyCallback(evutil_socket_t fd, short what, void *arg) { Reply* reply = (Reply*)arg; if (reply->content.size() > 0 && reply->headers.find("Content-Type") == reply->headers.end()) { - LOGD(USCXML_INFO) << "Sending content without Content-Type header"; + LOGD(USCXML_INFO) << "Sending content without Content-Type header" << std::endl; } std::map::const_iterator headerIter = reply->headers.begin(); @@ -564,7 +564,7 @@ bool HTTPServer::registerServlet(const std::string& path, HTTPServlet* servlet) HTTPServer* INSTANCE = getInstance(); if (!INSTANCE->_httpHandle) { - LOGD(USCXML_INFO) << "Registering at unstarted HTTP Server"; + LOGD(USCXML_INFO) << "Registering at unstarted HTTP Server" << std::endl; return true; // this is the culprit! } @@ -701,7 +701,7 @@ void HTTPServer::run(void* instance) { while(INSTANCE->_isRunning) { event_base_dispatch(INSTANCE->_base); } - LOGD(USCXML_INFO) << "HTTP Server stopped"; + LOGD(USCXML_INFO) << "HTTP Server stopped" << std::endl; } void HTTPServer::determineAddress() { diff --git a/src/uscxml/util/URL.cpp b/src/uscxml/util/URL.cpp index 845a972..ded4ae8 100644 --- a/src/uscxml/util/URL.cpp +++ b/src/uscxml/util/URL.cpp @@ -694,54 +694,54 @@ URLFetcher::URLFetcher() { /* Name of proxy to use. */ if (envProxy) (curlError = curl_easy_setopt(_multiHandle, CURLOPT_PROXY, envProxy)) == CURLE_OK || - LOG(USCXML_ERROR) << "Cannot set curl proxy: " << curl_easy_strerror(curlError); + LOG(USCXML_ERROR) << "Cannot set curl proxy: " << curl_easy_strerror(curlError) << std::endl; /* set transfer mode (;type=) when doing FTP via an HTTP proxy */ if (envProxyTransferMode) (curlError = curl_easy_setopt(_multiHandle, CURLOPT_PROXY_TRANSFER_MODE, envProxyTransferMode)) == CURLE_OK || - LOG(USCXML_ERROR) << "Cannot set curl proxy transfer mode: " << curl_easy_strerror(curlError); + LOG(USCXML_ERROR) << "Cannot set curl proxy transfer mode: " << curl_easy_strerror(curlError) << std::endl; /* Set this to a bitmask value to enable the particular authentications methods you like. Use this in combination with CURLOPT_PROXYUSERPWD. Note that setting multiple bits may cause extra network round-trips. */ if (envProxyAuth) (curlError = curl_easy_setopt(_multiHandle, CURLOPT_PROXYAUTH, envProxyAuth)) == CURLE_OK || - LOG(USCXML_ERROR) << "Cannot set curl proxy authentication: " << curl_easy_strerror(curlError); + LOG(USCXML_ERROR) << "Cannot set curl proxy authentication: " << curl_easy_strerror(curlError) << std::endl; #if 0 /* This points to a linked list of headers used for proxy requests only, struct curl_slist kind */ if (envProxyHeader && unsupported) (curlError = curl_easy_setopt(_multiHandle, CURLOPT_PROXYHEADER, envProxyHeader)) == CURLE_OK || - LOG(USCXML_ERROR) << "Cannot set curl proxy header: " << curl_easy_strerror(curlError); + LOG(USCXML_ERROR) << "Cannot set curl proxy header: " << curl_easy_strerror(curlError) << std::endl; #endif /* "name" and "pwd" to use with Proxy when fetching. */ if (envProxyUsername) (curlError = curl_easy_setopt(_multiHandle, CURLOPT_PROXYUSERNAME, envProxyUsername)) == CURLE_OK || - LOG(USCXML_ERROR) << "Cannot set curl proxy username: " << curl_easy_strerror(curlError); + LOG(USCXML_ERROR) << "Cannot set curl proxy username: " << curl_easy_strerror(curlError) << std::endl; if (envProxyPassword) (curlError = curl_easy_setopt(_multiHandle, CURLOPT_PROXYPASSWORD, envProxyPassword)) == CURLE_OK || - LOG(USCXML_ERROR) << "Cannot set curl proxy password: " << curl_easy_strerror(curlError); + LOG(USCXML_ERROR) << "Cannot set curl proxy password: " << curl_easy_strerror(curlError) << std::endl; /* Port of the proxy, can be set in the proxy string as well with: "[host]:[port]" */ if (envProxyPort) (curlError = curl_easy_setopt(_multiHandle, CURLOPT_PROXYPORT, envProxyPort)) == CURLE_OK || - LOG(USCXML_ERROR) << "Cannot set curl proxy port: " << curl_easy_strerror(curlError); + LOG(USCXML_ERROR) << "Cannot set curl proxy port: " << curl_easy_strerror(curlError) << std::endl; #if 0 /* indicates type of proxy. accepted values are CURLPROXY_HTTP (default), CURLPROXY_SOCKS4, CURLPROXY_SOCKS4A and CURLPROXY_SOCKS5. */ if (envProxyType && unsupported) (curlError = curl_easy_setopt(_multiHandle, CURLOPT_PROXYTYPE, envProxyType)) == CURLE_OK || - LOG(USCXML_ERROR) << "Cannot set curl proxy type: " << curl_easy_strerror(curlError); + LOG(USCXML_ERROR) << "Cannot set curl proxy type: " << curl_easy_strerror(curlError) << std::endl; #endif /* "user:password" to use with proxy. */ if (envProxyUserPwd) (curlError = curl_easy_setopt(_multiHandle, CURLOPT_PROXYUSERPWD, envProxyUserPwd)) == CURLE_OK || - LOG(USCXML_ERROR) << "Cannot set curl proxy user password: " << curl_easy_strerror(curlError); + LOG(USCXML_ERROR) << "Cannot set curl proxy user password: " << curl_easy_strerror(curlError) << std::endl; #endif start(); @@ -767,7 +767,7 @@ void URLFetcher::fetchURL(URL& url) { std::string fromURL(url); (curlError = curl_easy_setopt(handle, CURLOPT_URL, fromURL.c_str())) == CURLE_OK || - LOGD(USCXML_ERROR) << "Cannot set url to " << std::string(url) << ": " << curl_easy_strerror(curlError); + LOGD(USCXML_ERROR) << "Cannot set url to " << std::string(url) << ": " << curl_easy_strerror(curlError) << std::endl; // (curlError = curl_easy_setopt(handle, CURLOPT_NOSIGNAL, 1)) == CURLE_OK || // LOG(USCXML_ERROR) << "Cannot set curl to ignore signals: " << curl_easy_strerror(curlError); @@ -779,37 +779,37 @@ void URLFetcher::fetchURL(URL& url) { // LOG(USCXML_ERROR) << "Cannot set verbose: " << curl_easy_strerror(curlError); (curlError = curl_easy_setopt(handle, CURLOPT_WRITEDATA, url._impl.get())) == CURLE_OK || - LOGD(USCXML_ERROR) << "Cannot register this as write userdata: " << curl_easy_strerror(curlError); + LOGD(USCXML_ERROR) << "Cannot register this as write userdata: " << curl_easy_strerror(curlError) << std::endl; (curlError = curl_easy_setopt(handle, CURLOPT_WRITEFUNCTION, URLImpl::writeHandler)) == CURLE_OK || - LOGD(USCXML_ERROR) << "Cannot set write callback: " << curl_easy_strerror(curlError); + LOGD(USCXML_ERROR) << "Cannot set write callback: " << curl_easy_strerror(curlError) << std::endl; (curlError = curl_easy_setopt(handle, CURLOPT_HEADERFUNCTION, URLImpl::headerHandler)) == CURLE_OK || - LOGD(USCXML_ERROR) << "Cannot request header from curl: " << curl_easy_strerror(curlError); + LOGD(USCXML_ERROR) << "Cannot request header from curl: " << curl_easy_strerror(curlError) << std::endl; (curlError = curl_easy_setopt(handle, CURLOPT_HEADERDATA, url._impl.get())) == CURLE_OK || - LOGD(USCXML_ERROR) << "Cannot register this as header userdata: " << curl_easy_strerror(curlError); + LOGD(USCXML_ERROR) << "Cannot register this as header userdata: " << curl_easy_strerror(curlError) << std::endl; (curlError = curl_easy_setopt(handle, CURLOPT_SSL_VERIFYPEER, false)) == CURLE_OK || - LOGD(USCXML_ERROR) << "Cannot forfeit peer verification: " << curl_easy_strerror(curlError); + LOGD(USCXML_ERROR) << "Cannot forfeit peer verification: " << curl_easy_strerror(curlError) << std::endl; (curlError = curl_easy_setopt(handle, CURLOPT_USERAGENT, "uscxml/" USCXML_VERSION)) == CURLE_OK || - LOGD(USCXML_ERROR) << "Cannot set our user agent string: " << curl_easy_strerror(curlError); + LOGD(USCXML_ERROR) << "Cannot set our user agent string: " << curl_easy_strerror(curlError) << std::endl; (curlError = curl_easy_setopt(handle, CURLOPT_FOLLOWLOCATION, true)) == CURLE_OK || - LOGD(USCXML_ERROR) << "Cannot enable follow redirects: " << curl_easy_strerror(curlError); + LOGD(USCXML_ERROR) << "Cannot enable follow redirects: " << curl_easy_strerror(curlError) << std::endl; if (instance->_envProxy) (curlError = curl_easy_setopt(handle, CURLOPT_PROXY, instance->_envProxy)) == CURLE_OK || - LOGD(USCXML_ERROR) << "Cannot set curl proxy: " << curl_easy_strerror(curlError); + LOGD(USCXML_ERROR) << "Cannot set curl proxy: " << curl_easy_strerror(curlError) << std::endl; if (url._impl->_requestType == URLRequestType::POST) { (curlError = curl_easy_setopt(handle, CURLOPT_POST, 1)) == CURLE_OK || - LOGD(USCXML_ERROR) << "Cannot set request type to post for " << std::string(url) << ": " << curl_easy_strerror(curlError); + LOGD(USCXML_ERROR) << "Cannot set request type to post for " << std::string(url) << ": " << curl_easy_strerror(curlError) << std::endl; (curlError = curl_easy_setopt(handle, CURLOPT_COPYPOSTFIELDS, url._impl->_outContent.c_str())) == CURLE_OK || - LOGD(USCXML_ERROR) << "Cannot set post data " << std::string(url) << ": " << curl_easy_strerror(curlError); + LOGD(USCXML_ERROR) << "Cannot set post data " << std::string(url) << ": " << curl_easy_strerror(curlError) << std::endl; // Disable "Expect: 100-continue" // curl_slist* disallowed_headers = 0; @@ -839,14 +839,14 @@ void URLFetcher::fetchURL(URL& url) { instance->_handlesToHeaders[handle] = headers; (curlError = curl_easy_setopt(handle, CURLOPT_HTTPHEADER, headers)) == CURLE_OK || - LOGD(USCXML_ERROR) << "Cannot headers for " << std::string(url) << ": " << curl_easy_strerror(curlError); + LOGD(USCXML_ERROR) << "Cannot headers for " << std::string(url) << ": " << curl_easy_strerror(curlError) << std::endl; // curl_slist_free_all(headers); } else if (url._impl->_requestType == URLRequestType::GET) { (curlError = curl_easy_setopt(handle, CURLOPT_HTTPGET, 1)) == CURLE_OK || - LOGD(USCXML_ERROR) << "Cannot set request type to get for " << std::string(url) << ": " << curl_easy_strerror(curlError); + LOGD(USCXML_ERROR) << "Cannot set request type to get for " << std::string(url) << ": " << curl_easy_strerror(curlError) << std::endl; } url._impl->downloadStarted(); @@ -896,7 +896,7 @@ void URLFetcher::run(void* instance) { while(fetcher->_isStarted) { fetcher->perform(); } - LOGD(USCXML_ERROR) << "URLFetcher thread stopped!"; + LOGD(USCXML_ERROR) << "URLFetcher thread stopped!" << std::endl; } void URLFetcher::perform() { @@ -913,7 +913,7 @@ void URLFetcher::perform() { } err = curl_multi_perform(_multiHandle, &stillRunning); if (err != CURLM_OK) { - LOGD(USCXML_WARN) << "curl_multi_perform: " << curl_multi_strerror(err); + LOGD(USCXML_WARN) << "curl_multi_perform: " << curl_multi_strerror(err) << std::endl; } } @@ -937,7 +937,7 @@ void URLFetcher::perform() { std::lock_guard lock(_mutex); err = curl_multi_timeout(_multiHandle, &curlTimeOut); if (err != CURLM_OK) { - LOGD(USCXML_WARN) << "curl_multi_timeout: " << curl_multi_strerror(err); + LOGD(USCXML_WARN) << "curl_multi_timeout: " << curl_multi_strerror(err) << std::endl; } } @@ -955,7 +955,7 @@ void URLFetcher::perform() { std::lock_guard lock(_mutex); err = curl_multi_fdset(_multiHandle, &fdread, &fdwrite, &fdexcep, &maxfd); if (err != CURLM_OK) { - LOGD(USCXML_WARN) << "curl_multi_fdset: " << curl_multi_strerror(err); + LOGD(USCXML_WARN) << "curl_multi_fdset: " << curl_multi_strerror(err) << std::endl; } } @@ -970,7 +970,7 @@ void URLFetcher::perform() { NULL, WSAGetLastError(), MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), (LPSTR)&s, 0, NULL); - LOGD(USCXML_WARN) << "select: " << s; + LOGD(USCXML_WARN) << "select: " << s << std::endl; LocalFree(s); #endif break; @@ -980,7 +980,7 @@ void URLFetcher::perform() { std::lock_guard lock(_mutex); err = curl_multi_perform(_multiHandle, &stillRunning); if (err != CURLM_OK) { - LOGD(USCXML_WARN) << "curl_multi_perform: " << curl_multi_strerror(err); + LOGD(USCXML_WARN) << "curl_multi_perform: " << curl_multi_strerror(err) << std::endl; } break; } @@ -995,7 +995,7 @@ void URLFetcher::perform() { _handlesToURLs[msg->easy_handle]._impl->downloadCompleted(); err = curl_multi_remove_handle(_multiHandle, msg->easy_handle); if (err != CURLM_OK) { - LOGD(USCXML_WARN) << "curl_multi_remove_handle: " << curl_multi_strerror(err); + LOGD(USCXML_WARN) << "curl_multi_remove_handle: " << curl_multi_strerror(err) << std::endl; } break; @@ -1003,7 +1003,7 @@ void URLFetcher::perform() { _handlesToURLs[msg->easy_handle]._impl->downloadFailed(msg->data.result); err = curl_multi_remove_handle(_multiHandle, msg->easy_handle); if (err != CURLM_OK) { - LOGD(USCXML_WARN) << "curl_multi_remove_handle: " << curl_multi_strerror(err); + LOGD(USCXML_WARN) << "curl_multi_remove_handle: " << curl_multi_strerror(err) << std::endl; } break; @@ -1013,7 +1013,7 @@ void URLFetcher::perform() { _handlesToHeaders.erase(msg->easy_handle); } else { - LOGD(USCXML_ERROR) << "Curl reports info on unfinished download?!"; + LOGD(USCXML_ERROR) << "Curl reports info on unfinished download?!" << std::endl; } } } diff --git a/test/src/test-serialization.cpp b/test/src/test-serialization.cpp index 9acca09..a833eef 100644 --- a/test/src/test-serialization.cpp +++ b/test/src/test-serialization.cpp @@ -95,7 +95,7 @@ int main(int argc, char** argv) { sourceXML = "/Users/sradomski/Documents/TK/Code/uscxml/test/w3c/ecma/test557.scxml"; Interpreter interpreter = Interpreter::fromURL(sourceXML); - LOGD(USCXML_INFO) << "Processing " << interpreter.getImpl()->getBaseURL(); + LOGD(USCXML_INFO) << "Processing " << interpreter.getImpl()->getBaseURL() << std::endl; if (interpreter) { interpreter.addMonitor(&vm); diff --git a/test/src/test-snippets.cpp b/test/src/test-snippets.cpp index 968d65d..40b581b 100644 --- a/test/src/test-snippets.cpp +++ b/test/src/test-snippets.cpp @@ -32,6 +32,6 @@ void microstep_snippet() { } int main(int argc, char** argv) { - Logger::getDefault().log(USCXML_FATAL) << "Foo!" << " BAR?"; + Logger::getDefault().log(USCXML_FATAL) << "Foo!" << " BAR?" << std::endl; microstep_snippet(); } diff --git a/test/src/test-stress.cpp b/test/src/test-stress.cpp index 1f8d8ef..4d395ab 100644 --- a/test/src/test-stress.cpp +++ b/test/src/test-stress.cpp @@ -81,7 +81,7 @@ int main(int argc, char** argv) { Interpreter interpreter = Interpreter::fromURL(std::string(argv[optind]) + PATH_SEPERATOR + entryIter->first); // Interpreter interpreter = Interpreter::fromURL("/Users/sradomski/Documents/TK/Code/uscxml/test/w3c/ecma/test422.scxml"); - LOGD(USCXML_INFO) << "Processing " << interpreter.getImpl()->getBaseURL(); + LOGD(USCXML_INFO) << "Processing " << interpreter.getImpl()->getBaseURL() << std::endl; if (interpreter) { interpreter.addMonitor(&vm); -- cgit v0.12