astarte-platform / astarte-device-sdk-rust

Apache License 2.0
6 stars 12 forks source link

feat(error): imporve the error and log reporting #359

Closed joshuachp closed 4 months ago

joshuachp commented 4 months ago

This PR refactors the logging system to use the tracing crate, a more suitable alternative for async libraries. The change introduces new features like instrumentation, structured logs, and spans, improving logging, debugging, and error reporting. Additionally, the error chain is now reported in full using the Report struct.

codecov[bot] commented 4 months ago

Codecov Report

Attention: Patch coverage is 14.28571% with 30 lines in your changes missing coverage. Please review.

Project coverage is 75.6%. Comparing base (a7cc3a1) to head (ab7b52b). Report is 1 commits behind head on master.

Additional details and impacted files | [Files](https://app.codecov.io/gh/astarte-platform/astarte-device-sdk-rust/pull/359?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=astarte-platform) | Coverage Δ | | |---|---|---| | [src/builder.rs](https://app.codecov.io/gh/astarte-platform/astarte-device-sdk-rust/pull/359?src=pr&el=tree&filepath=src%2Fbuilder.rs&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=astarte-platform#diff-c3JjL2J1aWxkZXIucnM=) | `77.8% <ø> (ø)` | | | [src/interface/def.rs](https://app.codecov.io/gh/astarte-platform/astarte-device-sdk-rust/pull/359?src=pr&el=tree&filepath=src%2Finterface%2Fdef.rs&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=astarte-platform#diff-c3JjL2ludGVyZmFjZS9kZWYucnM=) | `73.0% <ø> (ø)` | | | [src/interface/mapping/mod.rs](https://app.codecov.io/gh/astarte-platform/astarte-device-sdk-rust/pull/359?src=pr&el=tree&filepath=src%2Finterface%2Fmapping%2Fmod.rs&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=astarte-platform#diff-c3JjL2ludGVyZmFjZS9tYXBwaW5nL21vZC5ycw==) | `56.0% <ø> (ø)` | | | [src/interface/mod.rs](https://app.codecov.io/gh/astarte-platform/astarte-device-sdk-rust/pull/359?src=pr&el=tree&filepath=src%2Finterface%2Fmod.rs&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=astarte-platform#diff-c3JjL2ludGVyZmFjZS9tb2QucnM=) | `78.6% <ø> (ø)` | | | [src/interfaces.rs](https://app.codecov.io/gh/astarte-platform/astarte-device-sdk-rust/pull/359?src=pr&el=tree&filepath=src%2Finterfaces.rs&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=astarte-platform#diff-c3JjL2ludGVyZmFjZXMucnM=) | `77.5% <ø> (ø)` | | | [src/introspection.rs](https://app.codecov.io/gh/astarte-platform/astarte-device-sdk-rust/pull/359?src=pr&el=tree&filepath=src%2Fintrospection.rs&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=astarte-platform#diff-c3JjL2ludHJvc3BlY3Rpb24ucnM=) | `100.0% <ø> (ø)` | | | [src/store/memory.rs](https://app.codecov.io/gh/astarte-platform/astarte-device-sdk-rust/pull/359?src=pr&el=tree&filepath=src%2Fstore%2Fmemory.rs&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=astarte-platform#diff-c3JjL3N0b3JlL21lbW9yeS5ycw==) | `97.2% <ø> (ø)` | | | [src/store/sqlite.rs](https://app.codecov.io/gh/astarte-platform/astarte-device-sdk-rust/pull/359?src=pr&el=tree&filepath=src%2Fstore%2Fsqlite.rs&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=astarte-platform#diff-c3JjL3N0b3JlL3NxbGl0ZS5ycw==) | `92.5% <ø> (ø)` | | | [src/topic.rs](https://app.codecov.io/gh/astarte-platform/astarte-device-sdk-rust/pull/359?src=pr&el=tree&filepath=src%2Ftopic.rs&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=astarte-platform#diff-c3JjL3RvcGljLnJz) | `52.0% <ø> (ø)` | | | [src/transport/grpc/mod.rs](https://app.codecov.io/gh/astarte-platform/astarte-device-sdk-rust/pull/359?src=pr&el=tree&filepath=src%2Ftransport%2Fgrpc%2Fmod.rs&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=astarte-platform#diff-c3JjL3RyYW5zcG9ydC9ncnBjL21vZC5ycw==) | `70.6% <ø> (ø)` | | | ... and [12 more](https://app.codecov.io/gh/astarte-platform/astarte-device-sdk-rust/pull/359?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=astarte-platform) | |