litdata icon indicating copy to clipboard operation
litdata copied to clipboard

Feat: configure logging. Add support for easy logging setup with sens…

Open sanggusti opened this issue 2 months ago • 3 comments

Fixes #685

Add `configure_logging` to `debugger.py`
  • [x] Was this discussed/agreed via a Github issue? (no need for typos and docs improvements)
  • [x] Did you read the contributor guideline, Pull Request section?
  • [x] Did you make sure to update the docs?
  • [x] Did you write any new necessary tests?

What does this PR do?

Featured #685 to add support for easy logging with configure_logging for the entire library with sensible defaults.

How to use:

from litdata.debugger import configure_logging

configure_logging()

PR review

Anyone in the community is free to review the PR once the tests have passed. If we didn't discuss your PR in GitHub issues there's a high chance it will not be merged.

Did you have fun?

Make sure you had fun coding 🙃 Me: lol

sanggusti avatar Oct 14 '25 04:10 sanggusti

Hey @sanggusti. Would you mind adding a bit more info to the description. Also, it seems the tests are failing.

tchaton avatar Oct 14 '25 13:10 tchaton

hi @tchaton.

it was a import-time error where I tried to call configure_logging directly at __init__.py like how example at litserve does the configure_logging but it fails on 2 tests. It makes caplog at test_dataset.py::test_streaming_dataset_max_cache_dir and test_reader.py::test_get_folder_size no longer capture message from the tests. So I drop it.

for now it's tested on test_debugger.py but not implemented at dataset.py or reader.py

sanggusti avatar Oct 14 '25 16:10 sanggusti

Codecov Report

:x: Patch coverage is 82.14286% with 5 lines in your changes missing coverage. Please review. :white_check_mark: Project coverage is 80%. Comparing base (e69fdd0) to head (421cef3). :warning: Report is 2 commits behind head on main.

Additional details and impacted files
@@         Coverage Diff         @@
##           main   #736   +/-   ##
===================================
- Coverage    80%    80%   -0%     
===================================
  Files        52     52           
  Lines      7330   7344   +14     
===================================
+ Hits       5868   5876    +8     
- Misses     1462   1468    +6     
:rocket: New features to boost your workflow:
  • :snowflake: Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

codecov[bot] avatar Oct 17 '25 14:10 codecov[bot]