summaryrefslogtreecommitdiffstats
path: root/apps/uscxml-browser.cpp
diff options
context:
space:
mode:
authorStefan Radomski <radomski@tk.informatik.tu-darmstadt.de>2013-09-23 16:30:04 (GMT)
committerStefan Radomski <radomski@tk.informatik.tu-darmstadt.de>2013-09-23 16:30:04 (GMT)
commitbe3c180fec71866a91b5f9297708d581bc1d6435 (patch)
tree830acee295b8456d1e629a0db6c3734f629074a3 /apps/uscxml-browser.cpp
parent8dde1311719b29c63efb379566916cb1aa9a7cd7 (diff)
downloaduscxml-be3c180fec71866a91b5f9297708d581bc1d6435.zip
uscxml-be3c180fec71866a91b5f9297708d581bc1d6435.tar.gz
uscxml-be3c180fec71866a91b5f9297708d581bc1d6435.tar.bz2
Added instant messaging invoker
Diffstat (limited to 'apps/uscxml-browser.cpp')
-rw-r--r--apps/uscxml-browser.cpp17
1 files changed, 13 insertions, 4 deletions
diff --git a/apps/uscxml-browser.cpp b/apps/uscxml-browser.cpp
index 34cf47a..fa108f8 100644
--- a/apps/uscxml-browser.cpp
+++ b/apps/uscxml-browser.cpp
@@ -39,6 +39,7 @@ class VerboseMonitor : public uscxml::InterpreterMonitor {
}
};
+#ifdef CMAKE_BUILD_TYPE_DEBUG
#ifdef HAS_EXECINFO_H
void printBacktrace(void** array, int size) {
@@ -105,6 +106,7 @@ void customTerminate() {
#endif
abort();
}
+#endif
void printUsageAndExit() {
printf("uscxml-browser version " USCXML_VERSION " (" CMAKE_BUILD_TYPE " build - " CMAKE_COMPILER_STRING ")\n");
@@ -126,22 +128,25 @@ void printUsageAndExit() {
int main(int argc, char** argv) {
using namespace uscxml;
- std::set_terminate(customTerminate);
-
#if defined(HAS_SIGNAL_H) && !defined(WIN32)
signal(SIGPIPE, SIG_IGN);
#endif
+#ifdef CMAKE_BUILD_TYPE_DEBUG
+ std::set_terminate(customTerminate);
+#endif
+
if (argc < 2) {
printUsageAndExit();
}
bool verbose = false;
bool useDot = false;
+ bool glogIsInitialized = false;
size_t port = 8080;
- google::InitGoogleLogging(argv[0]);
+
google::LogToStderr();
-
+
#ifndef _WIN32
opterr = 0;
#endif
@@ -150,6 +155,7 @@ int main(int argc, char** argv) {
switch(option) {
case 'l':
google::InitGoogleLogging(optarg);
+ glogIsInitialized = true;
break;
case 'e':
uscxml::Factory::pluginPath = optarg;
@@ -171,6 +177,9 @@ int main(int argc, char** argv) {
}
}
+ if (!glogIsInitialized)
+ google::InitGoogleLogging(argv[0]);
+
// for (int i = 0; i < argc; i++)
// std::cout << argv[i] << std::endl;
// std::cout << optind << std::endl;