Index: main.cpp =================================================================== diff -u -rcc1e9d6d55c816f3fcd626dc6948cca24da283b3 -r1aa53e9869f4c27d53dd9052271ca38befbe22e9 --- main.cpp (.../main.cpp) (revision cc1e9d6d55c816f3fcd626dc6948cca24da283b3) +++ main.cpp (.../main.cpp) (revision 1aa53e9869f4c27d53dd9052271ca38befbe22e9) @@ -79,6 +79,7 @@ bool gDisableUnhandledReport = false ; bool gDisableTimeout = false ; +bool gConsoleoutLogs = false ; bool gConsoleoutFrameInterface = false ; bool gConsoleoutCanInterface = false ; @@ -89,19 +90,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 */ /*! @@ -127,6 +135,12 @@ 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", QCoreApplication::translate("main", "Enable send low priority, empty message on the CANBus just to keep UI board CAN driver awake")); @@ -144,13 +158,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); @@ -169,6 +183,7 @@ gConsoleoutCanInterface = parser.isSet(optionConsoleoutCanInterface ); gConsoleoutFrameInterface = parser.isSet(optionConsoleoutFrameInterface ); + gConsoleoutLogs = parser.isSet(optionConsoleoutLogs ); gDisableUnhandledReport = parser.isSet(optionDisableUnhandledReport ); gDisableTimeout = parser.isSet(optionDisableTimeout ); @@ -280,8 +295,11 @@ 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 ()) .arg(app.applicationVersion())