Index: main.cpp =================================================================== diff -u -r9efb7cf51c882dc1f374df0b2a8b8c20efafaa4e -r66e87ea403ec12a273553284919684282d87bc6a --- main.cpp (.../main.cpp) (revision 9efb7cf51c882dc1f374df0b2a8b8c20efafaa4e) +++ main.cpp (.../main.cpp) (revision 66e87ea403ec12a273553284919684282d87bc6a) @@ -80,6 +80,7 @@ bool gDisableUnhandledReport = false ; bool gDisableTimeout = false ; +bool gConsoleoutLogs = false ; bool gConsoleoutFrameInterface = false ; bool gConsoleoutCanInterface = false ; @@ -90,19 +91,26 @@ * Denali * * Options: - * -h, --help Displays this help. - * -v, --version Displays version information. - * -c, --canOut Show the Can Frame Output - * -m, --msgOut Show the Message Output - * -0, --enable-keep-awake Enable send low priority, empty message on - * the CANBus just to keep UI board CAN driver - * awake - * -i, --fake-interval Test fake message interval(ms) - * -f, --fake-message Test fake message data - * will use default sequenced long fake message - * if set to 00(default) - * will used only if correct integer value - * assigned for interval option + * -h, --help Displays this help. + * -v, --version Displays version information. + * -c, --canOut Show the Can Frame Output + * -m, --msgOut Show the Message Output + * -l, --logOut Show the Logs Output + * -0, --enable-keep-awake Enable send low priority, empty message on + * the CANBus just to keep UI board CAN driver + * awake + * -i, --fake-interval Test fake message interval(ms) + * -f, --fake-message Test fake message data + * will use default sequenced long fake message + * if set to 00(default) + * will used only if correct integer value + * assigned for interval option + * -b, --fake-message-seq-at-begin Test fake message sequence at the beginning + * of the frame + * -u, --disable-unhandled-report Disable unhandled messages report as an + * error in the log + * -q, --disable-timeout Disables HD communication timeout + * * \endverbatim */ /*! @@ -128,6 +136,11 @@ QCoreApplication::translate("main", "Show the Message Output")); parser.addOption(optionConsoleoutFrameInterface); + // --- -m : msgOut + QCommandLineOption optionConsoleoutLogs( + QStringList() << "l" << "logOut", + QCoreApplication::translate("main", "Show the Logs Output")); + parser.addOption(optionConsoleoutLogs); // --- -0 : enable-keep-awake (the fast mode) QCommandLineOption optionSendEmptyKeepAwake(QStringList() << "0" << "enable-keep-awake", @@ -146,13 +159,13 @@ QStringList() << "f" << "fake-message", QCoreApplication::translate("main", "Test fake message data\n" "will use default sequenced long fake message if set to 00(default)\n" - "will used only if correct intger value assigned for interval option"), + "will used only if correct integer value assigned for interval option"), QCoreApplication::translate("main", "data")); parser.addOption(optionFakeData); - // --- -b : fake-message-seq-atbegin + // --- -b : fake-message-seq-at-begin QCommandLineOption optionFakeSeqAtBegin( - QStringList() << "b" << "fake-message-seq-atbegin", + QStringList() << "b" << "fake-message-seq-at-begin", QCoreApplication::translate("main", "Test fake message sequence at the beginning of the frame")); parser.addOption(optionFakeSeqAtBegin); @@ -166,12 +179,12 @@ QCoreApplication::translate("main", "Disables HD communication timeout")); parser.addOption(optionDisableTimeout); - // --- parse command lines parser.process(*qApp); gConsoleoutCanInterface = parser.isSet(optionConsoleoutCanInterface ); gConsoleoutFrameInterface = parser.isSet(optionConsoleoutFrameInterface ); + gConsoleoutLogs = parser.isSet(optionConsoleoutLogs ); gDisableUnhandledReport = parser.isSet(optionDisableUnhandledReport ); gDisableTimeout = parser.isSet(optionDisableTimeout ); @@ -283,7 +296,9 @@ Threads::registerTypes(); //! - Initializing Logger - _Logger.init(Threads::_Logger_Thread); + if(_Logger.init(Threads::_Logger_Thread)) { + _Logger.enableConsoleOut(gConsoleoutLogs); + } LOG_EVENT("UI," + QObject::tr("Application %1 Started,%2") .arg(app.applicationName ()) @@ -329,7 +344,6 @@ //! - Initializing Main Timer _MainTimer.init(); - //! - Initialize the QML Viewer and starts GUI int app_exec = -1; LOG_DEBUG("UI Initializing");