-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
DiagnosticLogs: Add CHIP_ERROR Parameter to Reset and EndLogCollection Methods #36775
base: master
Are you sure you want to change the base?
Conversation
PR #36775: Size comparison from 5d42d92 to 6e17037 Full report (69 builds for bl602, bl702, bl702l, cc13x4_26x4, cc32xx, cyw30739, efr32, esp32, linux, nrfconnect, nxp, psoc6, qpg, stm32, telink, tizen)
|
@vivien-apple Please review |
6e17037
to
5f8b982
Compare
PR #36775: Size comparison from 5d42d92 to 5f8b982 Full report (69 builds for bl602, bl702, bl702l, cc13x4_26x4, cc32xx, cyw30739, efr32, esp32, linux, nrfconnect, nxp, psoc6, qpg, stm32, telink, tizen)
|
5f8b982
to
9e7dc2d
Compare
PR #36775: Size comparison from 8606290 to 9e7dc2d Full report (69 builds for bl602, bl702, bl702l, cc13x4_26x4, cc32xx, cyw30739, efr32, esp32, linux, nrfconnect, nxp, psoc6, qpg, stm32, telink, tizen)
|
src/app/clusters/diagnostic-logs-server/DiagnosticLogsProviderDelegate.h
Outdated
Show resolved
Hide resolved
src/app/clusters/diagnostic-logs-server/DiagnosticLogsProviderDelegate.h
Outdated
Show resolved
Hide resolved
acb0ac5
to
5ca918e
Compare
PR #36775: Size comparison from 2c11741 to 5ca918e Full report (69 builds for bl602, bl702, bl702l, cc13x4_26x4, cc32xx, cyw30739, efr32, esp32, linux, nrfconnect, nxp, psoc6, qpg, stm32, telink, tizen)
|
src/app/clusters/diagnostic-logs-server/BDXDiagnosticLogsProvider.h
Outdated
Show resolved
Hide resolved
PR #36775: Size comparison from 2c11741 to 2697dd9 Full report (69 builds for bl602, bl702, bl702l, cc13x4_26x4, cc32xx, cyw30739, efr32, esp32, linux, nrfconnect, nxp, psoc6, qpg, stm32, telink, tizen)
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@pimpalemahesh even though it is explained in the linked issue, please update the summary of the issue to explain WHY these changes are being made and how it makes life better.
The reason for asking this is that these messages make their way in git log, and I would much rather understand the changes from the log than needing to also open an issue to follow up.
src/app/clusters/diagnostic-logs-server/DiagnosticLogsProviderDelegate.h
Outdated
Show resolved
Hide resolved
Note: the PR description does not end up in the git log. The commit messages from the actual commits do.... Those should be describing why the change is being made. And they are not. |
2697dd9
to
38bf32b
Compare
PR #36775: Size comparison from 9e203e2 to 38bf32b Full report (69 builds for bl602, bl702, bl702l, cc13x4_26x4, cc32xx, cyw30739, efr32, esp32, linux, nrfconnect, nxp, psoc6, qpg, stm32, telink, tizen)
|
src/app/clusters/diagnostic-logs-server/DiagnosticLogsProviderDelegate.h
Show resolved
Hide resolved
@@ -65,7 +65,7 @@ CHIP_ERROR LogProvider::GetLogForIntent(IntentEnum intent, MutableByteSpan & out | |||
err = CollectLog(sessionHandle, outBuffer, unusedOutIsEndOfLog); | |||
VerifyOrReturnError(CHIP_NO_ERROR == err, err, outBuffer.reduce_size(0)); | |||
|
|||
err = EndLogCollection(sessionHandle); | |||
err = EndLogCollection(sessionHandle, err); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So just to be clear: this always passes CHIP_NO_ERROR for the second arg, right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes. this is redundant I will remove it.
err = mDelegate->EndLogCollection(mLogSessionHandle, err); | ||
if (err == CHIP_ERROR_NOT_IMPLEMENTED) | ||
{ | ||
ChipLogError(DeviceLayer, "EndLogCollection not implemented in the delegate. Falling back to default behavior."); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Which default behavior? We do exactly the same thing no matter what EndLogCollection returns, raising questions about why it returns anything at all.....
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@bzbarsky-apple I added this to notify the application side if EndLogCollection is not implemented, in case the user misses it, as I have provided default implementations for earlier virtual methods.
I will remove it.
CHIP_ERROR err = mDelegate->EndLogCollection(mLogSessionHandle, error); | ||
if (err == CHIP_ERROR_NOT_IMPLEMENTED) | ||
{ | ||
ChipLogError(DeviceLayer, "EndLogCollection not implemented in the delegate. Falling back to default behavior."); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Again, this does not seem to describe what we really do, which is ignore the return value entirely.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@bzbarsky-apple I have removed these unnecessary lines. Please review.
3a7a394
to
4be99da
Compare
PR #36775: Size comparison from c1afc02 to 4be99da Full report (54 builds for bl602, bl702, bl702l, cc13x4_26x4, cc32xx, cyw30739, efr32, esp32, linux, nrfconnect, nxp, psoc6, qpg, stm32, telink, tizen)
|
…tion overload - Provides a default implementation for the EndLogCollection method with an additional error parameter. - This ensures backward compatibility, reduces the need for overriding in derived classes, and supports scenarios requiring context for log collection termination.
…tion - The one-argument EndLogCollection method is retained for backward compatibility. - The new two-argument overloaded EndLogCollection method will serve as the primary method to be implemented in delegates.
4be99da
to
433b19d
Compare
PR #36775: Size comparison from c1afc02 to 433b19d Full report (69 builds for bl602, bl702, bl702l, cc13x4_26x4, cc32xx, cyw30739, efr32, esp32, linux, nrfconnect, nxp, psoc6, qpg, stm32, telink, tizen)
|
Fixes #36776
Change Overview: