Add logger/Kconfig configuration allowing configuration of ESPP Logger max log level, which defaults to 4 (all logs compiled in)
Update espp::Logger to compile out the implementations of the various log functions depending on whether the config has enabled them.
Motivation and Context
As a system moves to production (or reaches the end of its partition size 😅), it may be necessary to optimize out log levels that are not being used so they do not contribute to code size.
How has this been tested?
Building and running logger/example on a QtPy ESP32s3 and compiling it with log level 4 (ALL) enabled, as well as compiling and running it with log level 2 (only errors and warnings). Checked that the compiled out logs did not print and that the resultant binary was smaller.
Screenshots (if appropriate, e.g. schematic, board, console logs, lab pictures):
New Menuconfig:
Execution with only warn and error compiled in:
Size with all logs:
Size with only error and warn logs:
That's a savings of ~31 kB, just by compiling out debug and info logs!
Types of changes
[ ] Bug fix (non-breaking change which fixes an issue)
[x] New feature (non-breaking change which adds functionality)
[ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
[x] Documentation Update
[ ] Hardware (schematic, board, system design) change
[x] Software change
Checklist:
[x] My change requires a change to the documentation.
[x] I have added / updated the documentation related to this change via either README or WIKI
Software
[ ] I have added tests to cover my changes.
[ ] I have updated the .github/workflows/build.yml file to add my new test to the automated cloud build github action.
[x] All new and existing tests passed.
[x] My code follows the code style of this project.
Description
logger/Kconfig
configuration allowing configuration of ESPP Loggermax log level
, which defaults to4
(all logs compiled in)espp::Logger
to compile out the implementations of the various log functions depending on whether the config has enabled them.Motivation and Context
As a system moves to production (or reaches the end of its partition size 😅), it may be necessary to optimize out log levels that are not being used so they do not contribute to code size.
How has this been tested?
Building and running
logger/example
on a QtPy ESP32s3 and compiling it with log level 4 (ALL) enabled, as well as compiling and running it with log level 2 (only errors and warnings). Checked that the compiled out logs did not print and that the resultant binary was smaller.Screenshots (if appropriate, e.g. schematic, board, console logs, lab pictures):
New Menuconfig:
Execution with only
warn
anderror
compiled in:Size with all logs:
Size with only error and warn logs:
That's a savings of ~31 kB, just by compiling out debug and info logs!
Types of changes
Checklist:
Software
.github/workflows/build.yml
file to add my new test to the automated cloud build github action.