refactor: improve logging and documentation across various modules #96
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This pull request focuses on improving error logging, updating docstrings for clarity, and adding module-level documentation across the admin and extractor API libraries. The most significant changes include replacing logger error statements with
logger.exception
for better tracebacks, simplifying and clarifying docstrings, and adding module/class documentation headers.Error Logging Improvements
logger.error
calls withlogger.exception
in exception handlers throughout the codebase to automatically include stack traces, and removed manualtraceback.format_exc()
usage. This affects files such asdefault_file_uploader.py
,default_source_uploader.py
,default_document_reference_retriever.py
,s3_service.py
,langchain_summarizer.py
, andgeneral_file_extractor.py
. [1] [2] [3] [4] [5] [6] [7] [8] [9] [10]Docstring and Documentation Updates
default_file_uploader.py
,default_source_uploader.py
,file_extractor.py
, andsource_extractor.py
. [1] [2] [3] [4]Code Quality and Style
extractor_type
property inInformationExtractor
to include a descriptive docstring.Configuration and Linting
pyproject.toml
to add missing docstring linting ignores for test files and API base files, improving code style enforcement.Cleanup
traceback
from files where it is no longer used due to logging improvements. [1] [2] [3] [4] [5]Let me know if you have questions about any specific change or want to discuss best practices for error handling and documentation!