Logging Levels for MDot Library 4.0.1

Home Forums mDot/xDot Logging Levels for MDot Library 4.0.1

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #31219
    Ajay K
    Participant

    Has anything changed in the way logging is implemented in the latest production mdot library 4.0.1? I have set the logging level to Trace_level and yet only info and warning messages are outputted out on the terminal window.

    Thanks,
    Ajay

    #31220
    Ajay K
    Participant

    Any thoughts on this issue as to why setting the logging level to the highest in my case TRACE_LEVEL doesn’t print out logTrace, logDebug statements?

    Thanks,
    Ajay

    #31223
    Jason Reiss
    Keymaster

    Logging was reduced in this release to reduce firmware size on xDot for new functionality. FOTA support was added for xDot if an external flash is attached.

    The library has this enabled by default. It can be changed in the MTSLog.h file where #ifndef NDEBUG occurs.

    https://github.com/MultiTechSystems/libmDot/blob/master/MTS-Lora/vendor/multitech/MTS-Utils/MTSLog.h

    #31224
    Ajay K
    Participant

    Hi Jason,

    Thanks for your response. I am using an MDot not xDot and we log a lot of our debug entries to troubleshoot in the field using logTrace and logDebug, based on the logging level set. Currently the MDot when we set the log level to trace level doesn’t print out the logTrace and logDebug statements.

    Are you saying this depends on the library being compiled using some #defines being set during the compile time?

    We are using the latest libmDot located here https://github.com/MultiTechSystems/libmDot and not sure how the production library is compiled and with what #defines?

    Thanks,
    Ajay

    #31225
    Jason Reiss
    Keymaster

    Change MTSLog.h to include logTrace and logDebug.

    #31226
    Ajay K
    Participant

    Hey Jason,

    Sorry I am not sure what you mean by include logTrace and logDebug. This is what I have in the mtslog.h under ndebug.

    #ifndef NDEBUG
    #define logDebug(format, ...) \
        __LOG__(mts::MTSLog::DEBUG_LEVEL, format, ##__VA_ARGS__)
    #define logTrace(format, ...) \
        __LOG__(mts::MTSLog::TRACE_LEVEL, format, ##__VA_ARGS__)
    #else
    #define logDebug(...)
    #define logTrace(...)
    #endif  // NDEBUG

    Thanks,
    Ajay

    #31227
    Jason Reiss
    Keymaster

    This will compile out the logTrace and logDebug when NDEBUG is defined. If you do not see logTrace or logDebug messages then your build has NDEBUG defined.

    
    #ifndef NDEBUG
    

    Since NDEBUG is defined you could change this to an #ifdef to include logDebug and logTrace instead. Or this line and to corresponding #endif line can be removed.

    #31228
    Ajay K
    Participant

    Thanks Jason, I missed the “ifndef NDEBUG”. Thanks a lot for your inputs.

    Thanks,
    Ajay

Viewing 8 posts - 1 through 8 (of 8 total)
  • You must be logged in to reply to this topic.