-
Notifications
You must be signed in to change notification settings - Fork 156
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Logging from CHIP code (CON-1243) #999
Comments
Logging.ccp has the implementation details about how chip SDK logs. Log format for If you see, the I'll see if this can be fixed somehow. |
The reason for this is to support debugging in the field. If you enable debugging I start a web server and which supports a URL that grabs the log buffer. So I have redirect the log into RAM instead of the console. Now there is no need for wires into the unit. I put the code for making the MDNS entry in this issue, #1018 Then I use the webserver from ESP SDK to send the log buffer when you ask for it. |
@jonsmirl @shubhamdp It seems that using Disable all Log-Categories: chip::Logging::SetLogFilter(chip::Logging::kLogCategory_None); or specific categories: chip::Logging::SetLogFilter(chip::Logging::kLogCategory_Error);
chip::Logging::SetLogFilter(chip::Logging::kLogCategory_Detail);
chip::Logging::SetLogFilter(chip::Logging::kLogCategory_Progress);
... Creating a callback for redirecting the CHIP logging: chip::Logging::SetLogRedirectCallback(LogRedirectCb); The callback function supplies both the log category and log module for filtering within the handler: LogRedirectCallback_t = void (*)(const char * module, uint8_t category, const char * msg, va_list args); |
@sdrasti, thank you for pointing out the log redirection callback in the connectedhomeip repository. @jonsmirl, you’ll also need to set up log redirection for CHIP logs. You can refer to the following: Log Redirection in CHIP. @jonsmirl you will have to set the log redirection for CHIP logs as well. (ref: https://github.com/project-chip/connectedhomeip/blob/master/src/lib/support/logging/TextOnlyLogging.cpp#L199) This will prevent the current redirection through Platform::LogV(), which currently only forwards the middle part of the logs to |
I'm using this to redirect the ESP log
That works without problem for ESP_LOG type messages, but CHIP isn't using ESP_LOG for everything.
I see this on my console
and this in the redirected log
The log prefix "I (8317) chip[DIS]: " is missing in the redirected log.
The text was updated successfully, but these errors were encountered: