orhun / systeroid

A more powerful alternative to sysctl(8) with a terminal user interface 🐧
https://systeroid.cli.rs
Apache License 2.0
1.28k stars 23 forks source link

feat(tui): improve logging #83

Closed orhun closed 1 year ago

orhun commented 1 year ago

Description

This PR improves the logging by using the log crate for events and also adds logging for the TUI.

Motivation and Context

Closes #11

How Has This Been Tested?

Unit tests.

Screenshots / Logs (if applicable)

TBA.

Types of Changes

Checklist:

Todos:

codecov-commenter commented 1 year ago

Codecov Report

Patch coverage: 39.07% and project coverage change: -2.70 :warning:

Comparison is base (80be6c5) 79.64% compared to head (448fde8) 76.94%.

:mega: This organization is not using Codecov’s GitHub App Integration. We recommend you install it so Codecov can continue to function properly for your repositories. Learn more

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #83 +/- ## ========================================== - Coverage 79.64% 76.94% -2.70% ========================================== Files 23 23 Lines 1429 1500 +71 ========================================== + Hits 1138 1154 +16 - Misses 291 346 +55 ``` | Flag | Coverage Δ | | |---|---|---| | unit-tests | `76.94% <39.07%> (-2.70%)` | :arrow_down: | Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Orhun+Parmaks%C4%B1z#carryforward-flags-in-the-pull-request-comment) to find out more. | [Impacted Files](https://codecov.io/gh/orhun/systeroid/pull/83?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Orhun+Parmaks%C4%B1z) | Coverage Δ | | |---|---|---| | [systeroid-tui/tests/integration\_test.rs](https://codecov.io/gh/orhun/systeroid/pull/83?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Orhun+Parmaks%C4%B1z#diff-c3lzdGVyb2lkLXR1aS90ZXN0cy9pbnRlZ3JhdGlvbl90ZXN0LnJz) | `100.00% <ø> (ø)` | | | [systeroid/src/main.rs](https://codecov.io/gh/orhun/systeroid/pull/83?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Orhun+Parmaks%C4%B1z#diff-c3lzdGVyb2lkL3NyYy9tYWluLnJz) | `0.00% <0.00%> (ø)` | | | [systeroid-tui/src/command.rs](https://codecov.io/gh/orhun/systeroid/pull/83?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Orhun+Parmaks%C4%B1z#diff-c3lzdGVyb2lkLXR1aS9zcmMvY29tbWFuZC5ycw==) | `76.82% <11.77%> (-21.26%)` | :arrow_down: | | [systeroid/src/app.rs](https://codecov.io/gh/orhun/systeroid/pull/83?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Orhun+Parmaks%C4%B1z#diff-c3lzdGVyb2lkL3NyYy9hcHAucnM=) | `62.61% <25.00%> (ø)` | | | [systeroid-tui/src/app.rs](https://codecov.io/gh/orhun/systeroid/pull/83?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Orhun+Parmaks%C4%B1z#diff-c3lzdGVyb2lkLXR1aS9zcmMvYXBwLnJz) | `63.45% <30.00%> (+0.08%)` | :arrow_up: | | [systeroid-tui/src/lib.rs](https://codecov.io/gh/orhun/systeroid/pull/83?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Orhun+Parmaks%C4%B1z#diff-c3lzdGVyb2lkLXR1aS9zcmMvbGliLnJz) | `58.83% <46.16%> (-2.71%)` | :arrow_down: | | [systeroid-tui/src/ui.rs](https://codecov.io/gh/orhun/systeroid/pull/83?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Orhun+Parmaks%C4%B1z#diff-c3lzdGVyb2lkLXR1aS9zcmMvdWkucnM=) | `76.68% <48.65%> (-6.48%)` | :arrow_down: | | [systeroid-core/src/config.rs](https://codecov.io/gh/orhun/systeroid/pull/83?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Orhun+Parmaks%C4%B1z#diff-c3lzdGVyb2lkLWNvcmUvc3JjL2NvbmZpZy5ycw==) | `98.15% <66.67%> (-1.85%)` | :arrow_down: | | [systeroid-core/src/sysctl/controller.rs](https://codecov.io/gh/orhun/systeroid/pull/83?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Orhun+Parmaks%C4%B1z#diff-c3lzdGVyb2lkLWNvcmUvc3JjL3N5c2N0bC9jb250cm9sbGVyLnJz) | `77.23% <77.78%> (-0.89%)` | :arrow_down: | | [systeroid-core/src/sysctl/parameter.rs](https://codecov.io/gh/orhun/systeroid/pull/83?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Orhun+Parmaks%C4%B1z#diff-c3lzdGVyb2lkLWNvcmUvc3JjL3N5c2N0bC9wYXJhbWV0ZXIucnM=) | `90.22% <100.00%> (+0.11%)` | :arrow_up: | | ... and [2 more](https://codecov.io/gh/orhun/systeroid/pull/83?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Orhun+Parmaks%C4%B1z) | | ... and [1 file with indirect coverage changes](https://codecov.io/gh/orhun/systeroid/pull/83/indirect-changes?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Orhun+Parmaks%C4%B1z) Help us with your feedback. Take ten seconds to tell us [how you rate us](https://about.codecov.io/nps?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Orhun+Parmaks%C4%B1z). Have a feature suggestion? [Share it here.](https://app.codecov.io/gh/feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Orhun+Parmaks%C4%B1z)

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Do you have feedback about the report comment? Let us know in this issue.