user88822: Why?
In Arduino IDE you can set the core debug level, however, this only sets debug level for files in Arduino-esp32 but the core which is distributed as a precompiled library in .sdk files, located in your Arduinio installation folder, is unaffected - the debug level remains the default “error”.

user88822: What?
If you want to change the core code or debug level, you need to clone the repo: https://github.com/espressif/esp32-arduino-lib-builder, make the modifications there, compile and apply the changes (automatically by the build script).
How?
There are 2 basic approaches. Both of them involve editing file esp32-arduino-lib-builder/configs/defconfig.common.
The first option is to edit the file directly and then build.
Later you can git restore configs/defconfig.common to go back.
The second option is to copy the file cp configs/defconfig.common configs/defconfig.debug, edit the debug version and then compile.
Open the defconfig file
vim configs/defconfig.common or vim configs/defconfig.debug
Edit line 45 containing by default CONFIG_LOG_DEFAULT_LEVEL_ERROR=y to one of the following lines depending on your desired log level:
CONFIG_LOG_DEFAULT_LEVEL_NONE=y # No output
CONFIG_LOG_DEFAULT_LEVEL_ERROR=y # Errors - default
CONFIG_LOG_DEFAULT_LEVEL_WARN=y # Warnings
CONFIG_LOG_DEFAULT_LEVEL_INFO=y # Info
CONFIG_LOG_DEFAULT_LEVEL_DEBUG=y # Debug
CONFIG_LOG_DEFAULT_LEVEL_VERBOSE=y # Verbose - All of the above

Then simply build the libs for all SoCs or one specific SoC. Note that building for all SoCs takes a lot of time, so if you work only with one specific SoC, build only for that one.
If you have copied the defconfig file and the debug settings are in file configs/defconfig.debug add flag debug
example : ./build.sh debug
Build all SoCs: ./build.sh
Build only selected SoC: ./build.sh -t <soc>
The exact text to choose the SoC:

esp32
esp32s2
esp32c3
esp32s3
Example: ./build.sh -t esp32
A wrong format or non-existing SoC will result in the error sed: can't read sdkconfig: No such file or directory


88822: <p><strong>Why?</strong>
In Arduino IDE you can set the core debug level, however, this only sets debug level for files in Arduino-esp32 but the core which is distributed as a precompiled library in .sdk files, located in your Arduinio installation folder, is unaffected - the debug level remains the default “error”.</p>
 88822: <p><strong>What?</strong>
If you want to change the core code or debug level, you need to clone the repo: <a href="https://github.com/espressif/esp32-arduino-lib-builder" rel="nofollow noreferrer">https://github.com/espressif/esp32-arduino-lib-builder</a>, make the modifications there, compile and apply the changes (automatically by the build script).</p>
<p><strong>How?</strong>
There are 2 basic approaches. Both of them involve editing file <code>esp32-arduino-lib-builder/configs/defconfig.common</code>.</p>
<p>The first option is to edit the file directly and then build.
Later you can <code>git restore configs/defconfig.common</code> to go back.</p>
<p>The second option is to copy the file <code>cp configs/defconfig.common configs/defconfig.debug</code>, edit the debug version and then compile.</p>
<p>Open the defconfig file
<code>vim configs/defconfig.common</code> or <code>vim configs/defconfig.debug</code></p>
<p>Edit <code>line 45</code> containing by default <code>CONFIG_LOG_DEFAULT_LEVEL_ERROR=y</code> to one of the following lines depending on your desired log level:</p>
<pre><code>CONFIG_LOG_DEFAULT_LEVEL_NONE=y # No output
CONFIG_LOG_DEFAULT_LEVEL_ERROR=y # Errors - default
CONFIG_LOG_DEFAULT_LEVEL_WARN=y # Warnings
CONFIG_LOG_DEFAULT_LEVEL_INFO=y # Info
CONFIG_LOG_DEFAULT_LEVEL_DEBUG=y # Debug
CONFIG_LOG_DEFAULT_LEVEL_VERBOSE=y # Verbose - All of the above
</code></pre>
<p>Then simply build the libs for all SoCs or one specific SoC. Note that building for all SoCs takes a lot of time, so if you work only with one specific SoC, build only for that one.
If you have copied the defconfig file and the debug settings are in file <code>configs/defconfig.debug</code> add flag <code>debug</code>
example : <code>./build.sh debug</code>
Build all SoCs: <code>./build.sh</code>
Build only selected SoC: <code>./build.sh -t &lt;soc&gt;</code>
The exact text to choose the SoC:</p>
<ul>
<li>esp32</li>
<li>esp32s2</li>
<li>esp32c3</li>
<li>esp32s3
Example: <code>./build.sh -t esp32</code>
A wrong format or non-existing SoC will result in the error <code>sed: can't read sdkconfig: No such file or directory</code></li>
</ul>
