diff options
author | Stefan Radomski <radomski@tk.informatik.tu-darmstadt.de> | 2013-09-23 16:30:04 (GMT) |
---|---|---|
committer | Stefan Radomski <radomski@tk.informatik.tu-darmstadt.de> | 2013-09-23 16:30:04 (GMT) |
commit | be3c180fec71866a91b5f9297708d581bc1d6435 (patch) | |
tree | 830acee295b8456d1e629a0db6c3734f629074a3 /apps/uscxml-browser.cpp | |
parent | 8dde1311719b29c63efb379566916cb1aa9a7cd7 (diff) | |
download | uscxml-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.cpp | 17 |
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; |