Skip to content

LittleFS should be built with -DLFS_NO_DEBUG -DLFS_NO_WARN -DLFS_NO_ERROR #103

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

Open
everslick opened this issue Jan 11, 2023 · 8 comments
Open

Comments

@everslick
Copy link

Otherwise it will pollute the serial output.

espressif/arduino-esp32#7700

@igrr
Copy link
Member

igrr commented Jan 11, 2023

I would instead suggest adding Kconfig options for LittleFS debug level in https://github.com/joltwallet/esp_littlefs/blob/master/Kconfig, and applying target_compile_definitions(${COMPONENT_LIB} PRIVATE LFS_NO_DEBUG) etc. in https://github.com/joltwallet/esp_littlefs/blob/master/CMakeLists.txt.

Adding compiler macros for littlefs internals seems a bit wrong at arduino-lib-builder level. This is something that should be handled by the component itself.

(Sorry for redirecting you to another repository, again!)

@everslick
Copy link
Author

Sorry for redirecting you to another repository, again!

hehe, no worries. I appreciate the input!

@igrr
Copy link
Member

igrr commented Jan 11, 2023

As an alternative, https://github.com/joltwallet/esp_littlefs/blob/f2a949fbb303b93a0ae1cd47f078c49de96a59a7/src/lfs_config.h#L44 could be modified to call ESP_LOGV instead of printf, then the log level can be controlled same way as all other IDF logs are.

(similar for other LFS_* macros: ESP_LOGD, ESP_LOGW, ESP_LOGI)

(I think I like this option more than keeping printfs and custom Kconfig options.)

@everslick
Copy link
Author

I think I like this option more than keeping printfs and custom Kconfig options.

me 2. thanks!

@everslick
Copy link
Author

so we should simply replace:
#define LFS_DEBUG(...) LFS_DEBUG_(__VA_ARGS__, "")
with:
#define LFS_DEBUG(...) ESP_LOGD("LFS", __VA_ARGS__)
correct?

@BrianPugh
Copy link

hey guys, sorry for the slow response; implementing this now.

@BrianPugh
Copy link

will be included in esp_littlefs 1.5.4, which should be released later today.

@BrianPugh
Copy link

implemented in the newly released esp_littlefs v1.5.4.

If everyone is happy with it, we can then close this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants