Skip to content
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

[Python] Adjust logging levels in Python controller #34346

Merged
merged 1 commit into from
Jul 16, 2024

Conversation

agners
Copy link
Contributor

@agners agners commented Jul 16, 2024

Use global loggers per-module which is more Pythonic and avoids unnecessary logger instances. Also use the module name as the logger name consistently.

Avoid using the warning level for messages which are really only informational. Also lower the log level of storage messages to debug, as they are really not that important. Drop some unnecessary logs like on every storage commit.

Copy link

PR #34346: Size comparison from 74768a8 to 84e8061

Full report (3 builds for cc32xx, stm32)
platform target config section 74768a8 84e8061 change % change
cc32xx air-purifier CC3235SF_LAUNCHXL FLASH 606406 606406 0 0.0
RAM 204508 204508 0 0.0
lock CC3235SF_LAUNCHXL FLASH 651730 651730 0 0.0
RAM 204780 204780 0 0.0
stm32 light STM32WB5MM-DK FLASH 473728 473728 0 0.0
RAM 144196 144196 0 0.0

Use global loggers per-module which is more Pythonic and avoids
unnecessary logger instances. Also use the module name as the logger
name consistently.

Avoid using the warning level for messages which are really only
informational. Also lower the log level of storage messages to debug,
as they are really not that important. Drop some unnecessary logs
like on every storage commit.
Copy link

github-actions bot commented Jul 16, 2024

PR #34346: Size comparison from 74768a8 to 876d802

Full report (85 builds for bl602, bl702, bl702l, cc13x4_26x4, cc32xx, cyw30739, efr32, esp32, linux, mbed, nrfconnect, nxp, psoc6, qpg, stm32, telink, tizen)
platform target config section 74768a8 876d802 change % change
bl602 lighting-app bl602 FLASH 1271432 1271432 0 0.0
RAM 95328 95328 0 0.0
bl602+mfd FLASH 1285946 1285946 0 0.0
RAM 95472 95472 0 0.0
bl602+rpc FLASH 1310648 1310648 0 0.0
RAM 103752 103752 0 0.0
bl702 lighting-app bl702 FLASH 1092542 1092542 0 0.0
RAM 15161 15161 0 0.0
bl702+mfd FLASH 1103236 1103236 0 0.0
RAM 15313 15313 0 0.0
bl702+rpc FLASH 1182352 1182352 0 0.0
RAM 24181 24181 0 0.0
bl706-eth FLASH 875672 875672 0 0.0
RAM 27272 27272 0 0.0
bl706-wifi FLASH 1128098 1128098 0 0.0
RAM 14605 14605 0 0.0
bl702l lighting-app bl702l FLASH 1079428 1079428 0 0.0
RAM 21732 21732 0 0.0
bl702l+mfd FLASH 1090690 1090690 0 0.0
RAM 21892 21892 0 0.0
cc13x4_26x4 lighting-app LP_EM_CC1354P10_6 FLASH 798528 798528 0 0.0
RAM 109180 109180 0 0.0
lock-ftd LP_EM_CC1354P10_6 FLASH 816572 816572 0 0.0
RAM 116948 116948 0 0.0
lock-mtd LP_EM_CC1354P10_6 FLASH 808208 808208 0 0.0
RAM 111236 111236 0 0.0
pump-app LP_EM_CC1354P10_6 FLASH 760872 760872 0 0.0
RAM 105328 105328 0 0.0
pump-controller-app LP_EM_CC1354P10_6 FLASH 746584 746584 0 0.0
RAM 105576 105576 0 0.0
cc32xx air-purifier CC3235SF_LAUNCHXL FLASH 606406 606406 0 0.0
RAM 204508 204508 0 0.0
lock CC3235SF_LAUNCHXL FLASH 651730 651730 0 0.0
RAM 204780 204780 0 0.0
cyw30739 light CYW30739B2-P5-EVK-01 unknown 2040 2040 0 0.0
FLASH 667649 667649 0 0.0
RAM 77644 77644 0 0.0
CYW30739B2-P5-EVK-02 unknown 2040 2040 0 0.0
FLASH 687501 687501 0 0.0
RAM 80276 80276 0 0.0
CYW30739B2-P5-EVK-03 unknown 2040 2040 0 0.0
FLASH 687501 687501 0 0.0
RAM 80276 80276 0 0.0
CYW930739M2EVB-02 unknown 2040 2040 0 0.0
FLASH 644445 644445 0 0.0
RAM 72712 72712 0 0.0
light-switch CYW30739B2-P5-EVK-01 unknown 2040 2040 0 0.0
FLASH 609297 609297 0 0.0
RAM 70804 70804 0 0.0
CYW30739B2-P5-EVK-02 unknown 2040 2040 0 0.0
FLASH 628933 628933 0 0.0
RAM 73356 73356 0 0.0
CYW30739B2-P5-EVK-03 unknown 2040 2040 0 0.0
FLASH 628933 628933 0 0.0
RAM 73356 73356 0 0.0
lock CYW30739B2-P5-EVK-01 unknown 2040 2040 0 0.0
FLASH 625033 625033 0 0.0
RAM 73820 73820 0 0.0
CYW30739B2-P5-EVK-02 unknown 2040 2040 0 0.0
FLASH 644741 644741 0 0.0
RAM 76372 76372 0 0.0
CYW30739B2-P5-EVK-03 unknown 2040 2040 0 0.0
FLASH 644741 644741 0 0.0
RAM 76372 76372 0 0.0
thermostat CYW30739B2-P5-EVK-01 unknown 2040 2040 0 0.0
FLASH 593389 593389 0 0.0
RAM 67788 67788 0 0.0
CYW30739B2-P5-EVK-02 unknown 2040 2040 0 0.0
FLASH 613241 613241 0 0.0
RAM 70420 70420 0 0.0
CYW30739B2-P5-EVK-03 unknown 2040 2040 0 0.0
FLASH 613241 613241 0 0.0
RAM 70420 70420 0 0.0
efr32 lighting-app BRD4187C FLASH 924620 924612 -8 -0.0
RAM 137528 137528 0 0.0
lock-app BRD4338a FLASH 733836 733828 -8 -0.0
RAM 207892 207892 0 0.0
window-app BRD4187C FLASH 1012660 1012652 -8 -0.0
RAM 129632 129632 0 0.0
esp32 all-clusters-app c3devkit DRAM 90860 90860 0 0.0
FLASH 1470656 1470656 0 0.0
IRAM 75570 75570 0 0.0
m5stack DRAM 117340 117340 0 0.0
FLASH 1539519 1539519 0 0.0
IRAM 125403 125403 0 0.0
linux air-purifier-app debug unknown 4592 4592 0 0.0
FLASH 2531280 2531280 0 0.0
RAM 125112 125112 0 0.0
all-clusters-app debug unknown 5368 5368 0 0.0
FLASH 5592382 5592382 0 0.0
RAM 493240 493240 0 0.0
all-clusters-minimal-app debug unknown 5288 5288 0 0.0
FLASH 5065440 5065440 0 0.0
RAM 235704 235704 0 0.0
bridge-app debug unknown 5256 5256 0 0.0
FLASH 4479680 4479680 0 0.0
RAM 212832 212832 0 0.0
chip-tool debug unknown 5728 5728 0 0.0
FLASH 11797879 11797879 0 0.0
RAM 547618 547618 0 0.0
chip-tool-ipv6only arm64 unknown 20128 20128 0 0.0
FLASH 10908108 10908108 0 0.0
RAM 596616 596616 0 0.0
fabric-admin debug unknown 5616 5616 0 0.0
FLASH 10879207 10879207 0 0.0
RAM 544650 544650 0 0.0
fabric-bridge-app debug unknown 4544 4544 0 0.0
FLASH 4248656 4248656 0 0.0
RAM 199000 199000 0 0.0
lighting-app debug+rpc+ui unknown 5936 5936 0 0.0
FLASH 5384066 5384066 0 0.0
RAM 224136 224136 0 0.0
lock-app debug unknown 5192 5192 0 0.0
FLASH 4546000 4546000 0 0.0
RAM 200456 200456 0 0.0
ota-provider-app debug unknown 4576 4576 0 0.0
FLASH 4199120 4199120 0 0.0
RAM 194544 194544 0 0.0
ota-requestor-app debug unknown 4512 4512 0 0.0
FLASH 4324448 4324448 0 0.0
RAM 199168 199168 0 0.0
shell debug unknown 4112 4112 0 0.0
FLASH 2805741 2805741 0 0.0
RAM 153008 153008 0 0.0
thermostat-no-ble arm64 unknown 9184 9184 0 0.0
FLASH 4169676 4169676 0 0.0
RAM 235840 235840 0 0.0
tv-app debug unknown 5472 5472 0 0.0
FLASH 5627648 5627648 0 0.0
RAM 342120 342120 0 0.0
tv-casting-app debug unknown 5096 5096 0 0.0
FLASH 9967822 9967822 0 0.0
RAM 402936 402936 0 0.0
mbed lock-app-release cy8cproto_062_4343w FLASH 1502884 1502884 0 0.0
RAM 226648 226648 0 0.0
nrfconnect all-clusters-app nrf52840dk_nrf52840 FLASH 882636 882636 0 0.0
RAM 142229 142229 0 0.0
nrf7002dk_nrf5340_cpuapp FLASH 953128 953128 0 0.0
RAM 140657 140657 0 0.0
all-clusters-minimal-app nrf52840dk_nrf52840 FLASH 828128 828128 0 0.0
RAM 141123 141123 0 0.0
nxp contact k32w0+release FLASH 576164 576164 0 0.0
RAM 70024 70024 0 0.0
k32w1+release FLASH 591520 591520 0 0.0
RAM 74056 74056 0 0.0
light k32w0+release FLASH 610392 610392 0 0.0
RAM 69500 69500 0 0.0
k32w1+release FLASH 675128 675128 0 0.0
RAM 82816 82816 0 0.0
psoc6 all-clusters cy8ckit_062s2_43012 FLASH 1615564 1615564 0 0.0
RAM 209692 209692 0 0.0
all-clusters-minimal cy8ckit_062s2_43012 FLASH 1536436 1536436 0 0.0
RAM 206588 206588 0 0.0
light cy8ckit_062s2_43012 FLASH 1463044 1463044 0 0.0
RAM 199876 199876 0 0.0
lock cy8ckit_062s2_43012 FLASH 1463788 1463788 0 0.0
RAM 224388 224388 0 0.0
qpg lighting-app qpg6105+debug FLASH 651404 651404 0 0.0
RAM 104564 104564 0 0.0
lock-app qpg6105+debug FLASH 611936 611936 0 0.0
RAM 99240 99240 0 0.0
stm32 light STM32WB5MM-DK FLASH 473728 473728 0 0.0
RAM 144196 144196 0 0.0
telink air-quality-sensor-app tlsr9528a_retention FLASH 632956 632956 0 0.0
RAM 50528 50528 0 0.0
all-clusters-app tlsr9118bdk40d FLASH 658818 658818 0 0.0
RAM 148408 148408 0 0.0
all-clusters-minimal-app tlsr9528a FLASH 779120 779120 0 0.0
RAM 113212 113212 0 0.0
bridge-app tlsr9258a FLASH 675952 675952 0 0.0
RAM 95304 95304 0 0.0
contact-sensor-app tlsr9528a_retention FLASH 634540 634540 0 0.0
RAM 50572 50572 0 0.0
light-switch-app-ota-shell-factory-data tlsr9528a FLASH 720400 720400 0 0.0
RAM 77148 77148 0 0.0
lighting-app-ota-factory-data tlsr9118bdk40d FLASH 613924 613924 0 0.0
RAM 144636 144636 0 0.0
lighting-app-ota-rpc-factory-data-4mb tlsr9518adk80d FLASH 801706 801706 0 0.0
RAM 103040 103040 0 0.0
lock-app-dfu tlsr9528a FLASH 666356 666356 0 0.0
RAM 69852 69852 0 0.0
ota-requestor-app tlsr9258a FLASH 695282 695282 0 0.0
RAM 95028 95028 0 0.0
pump-app tlsr9518adk80d FLASH 616814 616814 0 0.0
RAM 56952 56952 0 0.0
pump-controller-app tlsr9518adk80d FLASH 607198 607198 0 0.0
RAM 56752 56752 0 0.0
shell tlsr9518adk80d FLASH 466356 466356 0 0.0
RAM 72484 72484 0 0.0
smoke_co_alarm-app tlsr9528a_retention FLASH 641158 641158 0 0.0
RAM 52200 52200 0 0.0
temperature-measurement-app-mars-ota tlsr9518adk80d FLASH 651024 651024 0 0.0
RAM 60388 60388 0 0.0
thermostat tlsr9518adk80d FLASH 626088 626088 0 0.0
RAM 57084 57084 0 0.0
window-covering tlsr9118bdk40d FLASH 519318 519318 0 0.0
RAM 97800 97800 0 0.0
tizen all-clusters-app arm unknown 1584 1584 0 0.0
FLASH 1639300 1639300 0 0.0
RAM 48548 48548 0 0.0
chip-tool-ubsan arm unknown 2384 2384 0 0.0
FLASH 16293278 16293278 0 0.0
RAM 7156300 7156300 0 0.0

@yufengwangca yufengwangca merged commit 4ed9b7e into project-chip:master Jul 16, 2024
68 checks passed
@agners agners deleted the improve-python-logging branch July 16, 2024 15:26
agners added a commit to home-assistant-libs/chip-wheels that referenced this pull request Jul 17, 2024
By default the Python controller gets built with unit test configuration
enabled. This adds extra functionality to inject errors etc. for
testing. There is no known negative effect to have it enabled, but it is
certainly better to disable it for a production setup.

Furthermore this fixes error handling for APIs with callbacks and
improves logging somewhat.

Specifically, this integrates changes from the following PRs
- project-chip/connectedhomeip#34346
- project-chip/connectedhomeip#34354
- project-chip/connectedhomeip#34368
j-ororke pushed a commit to j-ororke/connectedhomeip that referenced this pull request Jul 31, 2024
Use global loggers per-module which is more Pythonic and avoids
unnecessary logger instances. Also use the module name as the logger
name consistently.

Avoid using the warning level for messages which are really only
informational. Also lower the log level of storage messages to debug,
as they are really not that important. Drop some unnecessary logs
like on every storage commit.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants