summaryrefslogtreecommitdiffstats
path: root/apps/uscxml-browser.cpp
diff options
context:
space:
mode:
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;