summaryrefslogtreecommitdiffstats
path: root/src/uscxml/interpreter
diff options
context:
space:
mode:
authorStefan Radomski <github@mintwerk.de>2016-12-09 12:54:46 (GMT)
committerStefan Radomski <github@mintwerk.de>2016-12-09 12:54:46 (GMT)
commit1e56658c2415d154428fe419d8f0134c59856b6e (patch)
tree2122ec471af63ec0549fb28973a68f9dfaf10f8a /src/uscxml/interpreter
parent9b8e09c3fde755ec26e5c21b9640f53ed9329d05 (diff)
downloaduscxml-1e56658c2415d154428fe419d8f0134c59856b6e.zip
uscxml-1e56658c2415d154428fe419d8f0134c59856b6e.tar.gz
uscxml-1e56658c2415d154428fe419d8f0134c59856b6e.tar.bz2
Oh how I despise MSVC
Diffstat (limited to 'src/uscxml/interpreter')
-rw-r--r--src/uscxml/interpreter/BasicContentExecutor.cpp8
-rw-r--r--src/uscxml/interpreter/BasicEventQueue.cpp2
-rw-r--r--src/uscxml/interpreter/FastMicroStep.cpp16
-rw-r--r--src/uscxml/interpreter/InterpreterImpl.cpp4
-rw-r--r--src/uscxml/interpreter/InterpreterMonitor.h6
-rw-r--r--src/uscxml/interpreter/Logging.h8
6 files changed, 18 insertions, 26 deletions
diff --git a/src/uscxml/interpreter/BasicContentExecutor.cpp b/src/uscxml/interpreter/BasicContentExecutor.cpp
index 1cf9c2f..0c77dfd 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<uint32_t>(delayAttr.value);
} else {
- LOG(ERROR) << "Cannot make sense of delay value " << delay << ": does not end in 's' or 'ms'";
+ LOG(USCXML_ERROR) << "Cannot make sense of delay value " << delay << ": does not end in 's' or 'ms'";
}
}
} catch (Event e) {
@@ -355,14 +355,14 @@ void BasicContentExecutor::process(XERCESC_NS::DOMElement* block, const X& xmlPr
} else if (iequals(tagName, xmlPrefix.str() + "script")) {
processScript(block);
} else {
- LOG(ERROR) << tagName;
+ LOG(USCXML_ERROR) << tagName;
assert(false);
}
} catch (ErrorEvent exc) {
Event e(exc);
_callbacks->enqueueInternal(e);
- LOG(ERROR) << exc << std::endl;
+ LOG(USCXML_ERROR) << exc << std::endl;
USCXML_MONITOR_CALLBACK1(_callbacks->getMonitors(), afterExecutingContent, block);
throw e; // will be catched in microstepper
@@ -646,7 +646,7 @@ Data BasicContentExecutor::elementAsData(XERCESC_NS::DOMElement* element) {
}
}
-// LOG(WARNING) << "Element " << DOMUtils::xPathForNode(element) << " did not yield any data";
+// LOG(USCXML_WARN) << "Element " << DOMUtils::xPathForNode(element) << " did not yield any data";
return Data();
}
diff --git a/src/uscxml/interpreter/BasicEventQueue.cpp b/src/uscxml/interpreter/BasicEventQueue.cpp
index 04ffc7c..3adbd2f 100644
--- a/src/uscxml/interpreter/BasicEventQueue.cpp
+++ b/src/uscxml/interpreter/BasicEventQueue.cpp
@@ -47,7 +47,7 @@ Event BasicEventQueue::dequeue(size_t blockMs) {
if (_queue.size() > 0) {
Event event = _queue.front();
_queue.pop_front();
-// LOG(ERROR) << event.name;
+// LOG(USCXML_ERROR) << event.name;
return event;
}
return Event();
diff --git a/src/uscxml/interpreter/FastMicroStep.cpp b/src/uscxml/interpreter/FastMicroStep.cpp
index 8711b62..6a5f9a1 100644
--- a/src/uscxml/interpreter/FastMicroStep.cpp
+++ b/src/uscxml/interpreter/FastMicroStep.cpp
@@ -1098,14 +1098,14 @@ bool FastMicroStep::hasLegalConfiguration() {
DOMElement* state = *sIter;
if (isMember(state, config)) {
if (foundScxmlChild) {
- LOG(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") << "'";
return false;
}
foundScxmlChild = scxmlChilds[i];
}
}
if (!foundScxmlChild) {
- LOG(ERROR) << "Invalid configuration: No childs of scxml root are active";
+ LOG(USCXML_ERROR) << "Invalid configuration: No childs of scxml root are active";
return false;
}
@@ -1119,14 +1119,14 @@ bool FastMicroStep::hasLegalConfiguration() {
}
}
if (!foundAtomicState) {
- LOG(ERROR) << "Invalid configuration: No atomic state is active";
+ LOG(USCXML_ERROR) << "Invalid configuration: No atomic state is active";
return false;
}
// the configuration contains no history pseudo-states
for (size_t i = 0; i < config.size(); i++) {
if (isHistory(Element<std::string>(config[i]))) {
- LOG(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";
return false;
}
}
@@ -1142,7 +1142,7 @@ bool FastMicroStep::hasLegalConfiguration() {
(iequals(LOCALNAME(parent), "state") ||
iequals(LOCALNAME(parent), "parallel"))) {
if (!isMember(parent, config)) {
- LOG(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";
return false;
}
}
@@ -1161,7 +1161,7 @@ bool FastMicroStep::hasLegalConfiguration() {
//std::cerr << childs[j] << std::endl;
if (isMember(childs[j], config)) {
if (foundChildState) {
- LOG(ERROR) << "Invalid configuration: Multiple childs of compound '" << ATTR_CAST(config[i], "id")
+ 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") << "'";
return false;
}
@@ -1169,7 +1169,7 @@ bool FastMicroStep::hasLegalConfiguration() {
}
}
if (!foundChildState) {
- LOG(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";
return false;
}
}
@@ -1181,7 +1181,7 @@ bool FastMicroStep::hasLegalConfiguration() {
NodeSet<std::string> childs = getChildStates(config[i]);
for (size_t j = 0; j < childs.size(); j++) {
if (!isMember(childs[j], config) && !isHistory(Element<std::string>(childs[j]))) {
- LOG(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";
return false;
}
}
diff --git a/src/uscxml/interpreter/InterpreterImpl.cpp b/src/uscxml/interpreter/InterpreterImpl.cpp
index 7b79988..0f77285 100644
--- a/src/uscxml/interpreter/InterpreterImpl.cpp
+++ b/src/uscxml/interpreter/InterpreterImpl.cpp
@@ -248,7 +248,7 @@ bool InterpreterImpl::isTrue(const std::string& expr) {
} catch (ErrorEvent e) {
// test 244: deliver error execution
- LOG(ERROR) << e;
+ LOG(USCXML_ERROR) << e;
// test 344
enqueueInternal(e);
@@ -280,7 +280,7 @@ Event InterpreterImpl::dequeueExternal(size_t blockMs) {
if (_currEvent) {
_dataModel.setEvent(_currEvent);
-// LOG(ERROR) << e.name;
+// LOG(USCXML_ERROR) << e.name;
// test 233
if (_currEvent.invokeid.size() > 0 &&
diff --git a/src/uscxml/interpreter/InterpreterMonitor.h b/src/uscxml/interpreter/InterpreterMonitor.h
index 2519cfd..80065f7 100644
--- a/src/uscxml/interpreter/InterpreterMonitor.h
+++ b/src/uscxml/interpreter/InterpreterMonitor.h
@@ -28,9 +28,9 @@
#include <mutex>
#define USCXML_MONITOR_CATCH(callback) \
-catch (Event e) { LOG(ERROR) << "Syntax error when calling " #callback " on monitors: " << std::endl << e << std::endl; } \
-catch (std::bad_weak_ptr e) { LOG(ERROR) << "Unclean shutdown " << std::endl; } \
-catch (...) { LOG(ERROR) << "An exception occurred when calling " #callback " on monitors"; } \
+catch (Event e) { LOG(USCXML_ERROR) << "Syntax error when calling " #callback " on monitors: " << std::endl << e << std::endl; } \
+catch (std::bad_weak_ptr e) { LOG(USCXML_ERROR) << "Unclean shutdown " << std::endl; } \
+catch (...) { LOG(USCXML_ERROR) << "An exception occurred when calling " #callback " on monitors"; } \
if (_state == USCXML_DESTROYED) { throw std::bad_weak_ptr(); }
#define USCXML_MONITOR_CALLBACK(callbacks, function) { \
diff --git a/src/uscxml/interpreter/Logging.h b/src/uscxml/interpreter/Logging.h
index 7746998..85d28ca 100644
--- a/src/uscxml/interpreter/Logging.h
+++ b/src/uscxml/interpreter/Logging.h
@@ -31,14 +31,6 @@
#define LOG(lvl) uscxml::Logger::getDefault().log(lvl)
#define LOG2(lvl, thing) uscxml::Logger::getDefault().log(lvl, thing);
-#define SCXML USCXML_SCXML
-#define TRACE USCXML_TRACE
-#define DEBUG USCXML_DEBUG
-#define INFO USCXML_INFO
-#define WARNING USCXML_WARN
-#define ERROR USCXML_ERROR
-#define FATAL USCXML_FATAL
-
namespace uscxml {
enum LogSeverity {