Commit 15d8036
committed
docs: Move logging documentation to docs/ and fix all linting issues
## Documentation Changes
- Created `docs/development/logging.md` with comprehensive mkdocs-formatted documentation
- Architecture overview
- Configuration reference
- Complete usage examples
- API reference
- Migration guide
- Troubleshooting guide
- Updated `CLAUDE.md` to reference the detailed documentation instead of duplicating content
- Kept brief summary with quick example
- Added link to full documentation
## Linting Fixes
### Ruff (✅ All checks passing)
- Removed unused imports (Path, Any, get_context)
- Converted `Optional[X]` to `X | None` (UP045)
- Removed `noqa` directives for non-enabled checks
- Fixed timezone import (`UTC` instead of `timezone`)
- Combined nested `with` statements in tests
### Mypy (✅ No errors)
- Fixed ContextVar default value (B039): Changed from `LogContext()` to `None`
- Added `get_context()` initialization logic to handle None case
- Added `DOCUMENT_PROCESSING` constant to PipelineStage class
- Added `# type: ignore[misc]` comments to pytest.mark.asyncio decorators
### Code Quality Improvements
- All files now use modern Python 3.12+ type hints
- Proper null handling in ContextVar
- Consistent code formatting throughout
## Files Modified
- `docs/development/logging.md` - NEW comprehensive documentation
- `CLAUDE.md` - Simplified with reference to detailed docs
- `backend/core/logging_context.py` - Fixed ContextVar, added constant
- `backend/core/log_storage_service.py` - Type hint modernization
- `backend/core/enhanced_logging.py` - Import cleanup, type hints
- `backend/core/enhanced_logging_example.py` - Type hints, combined with statements
- `backend/tests/unit/test_enhanced_logging.py` - Type ignore comments, combined with
- `backend/poetry.lock` - Updated with python-json-logger dependency
## Verification
✅ Ruff: All checks passing
✅ Mypy: No type errors found
📝 Note: Pylint/pydocstyle skipped (not in current poetry environment)
The enhanced logging implementation is now fully documented and lint-compliant.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>1 parent 5e44c48 commit 15d8036
File tree
8 files changed
+729
-223
lines changed- backend
- core
- tests/unit
- docs/development
8 files changed
+729
-223
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
404 | 404 | | |
405 | 405 | | |
406 | 406 | | |
407 | | - | |
408 | | - | |
409 | | - | |
410 | | - | |
411 | | - | |
412 | | - | |
413 | | - | |
414 | | - | |
415 | | - | |
416 | | - | |
417 | | - | |
418 | | - | |
419 | | - | |
420 | | - | |
421 | | - | |
422 | | - | |
423 | | - | |
424 | | - | |
425 | | - | |
426 | | - | |
427 | | - | |
428 | | - | |
429 | | - | |
430 | | - | |
431 | | - | |
432 | | - | |
433 | | - | |
| 407 | + | |
434 | 408 | | |
| 409 | + | |
435 | 410 | | |
436 | 411 | | |
437 | 412 | | |
438 | 413 | | |
439 | 414 | | |
440 | 415 | | |
441 | | - | |
442 | | - | |
443 | | - | |
444 | | - | |
445 | | - | |
446 | | - | |
447 | | - | |
448 | | - | |
449 | | - | |
450 | | - | |
451 | | - | |
452 | | - | |
453 | | - | |
454 | | - | |
455 | | - | |
456 | | - | |
457 | | - | |
458 | | - | |
459 | | - | |
460 | | - | |
461 | | - | |
462 | | - | |
463 | | - | |
464 | | - | |
465 | | - | |
466 | | - | |
467 | | - | |
468 | | - | |
469 | | - | |
470 | | - | |
471 | | - | |
472 | | - | |
473 | | - | |
474 | | - | |
475 | | - | |
476 | | - | |
477 | | - | |
478 | | - | |
479 | | - | |
480 | | - | |
481 | | - | |
482 | | - | |
483 | | - | |
484 | | - | |
485 | | - | |
486 | | - | |
487 | | - | |
488 | | - | |
489 | | - | |
490 | | - | |
491 | | - | |
492 | | - | |
493 | | - | |
494 | | - | |
495 | | - | |
496 | | - | |
497 | | - | |
| 416 | + | |
| 417 | + | |
| 418 | + | |
498 | 419 | | |
499 | 420 | | |
500 | | - | |
501 | | - | |
502 | | - | |
503 | | - | |
504 | | - | |
505 | | - | |
506 | | - | |
507 | | - | |
508 | | - | |
509 | | - | |
510 | | - | |
511 | | - | |
512 | | - | |
513 | | - | |
514 | | - | |
515 | | - | |
516 | | - | |
517 | | - | |
518 | | - | |
519 | | - | |
520 | | - | |
521 | | - | |
522 | | - | |
523 | | - | |
524 | | - | |
| 421 | + | |
525 | 422 | | |
526 | | - | |
527 | | - | |
528 | | - | |
529 | | - | |
530 | | - | |
531 | | - | |
532 | | - | |
533 | | - | |
534 | | - | |
535 | | - | |
536 | | - | |
537 | | - | |
538 | | - | |
539 | | - | |
540 | | - | |
541 | | - | |
542 | | - | |
543 | | - | |
544 | | - | |
545 | | - | |
546 | | - | |
547 | | - | |
548 | | - | |
549 | | - | |
550 | | - | |
551 | | - | |
552 | | - | |
553 | | - | |
554 | | - | |
555 | | - | |
| 423 | + | |
| 424 | + | |
| 425 | + | |
| 426 | + | |
| 427 | + | |
| 428 | + | |
556 | 429 | | |
557 | 430 | | |
558 | 431 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
24 | | - | |
25 | | - | |
26 | 24 | | |
27 | 25 | | |
28 | 26 | | |
29 | 27 | | |
30 | | - | |
31 | 28 | | |
32 | 29 | | |
33 | | - | |
34 | | - | |
35 | | - | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
36 | 33 | | |
37 | 34 | | |
38 | 35 | | |
| |||
48 | 45 | | |
49 | 46 | | |
50 | 47 | | |
51 | | - | |
| 48 | + | |
52 | 49 | | |
53 | 50 | | |
54 | 51 | | |
| |||
72 | 69 | | |
73 | 70 | | |
74 | 71 | | |
75 | | - | |
| 72 | + | |
76 | 73 | | |
77 | 74 | | |
78 | 75 | | |
| |||
108 | 105 | | |
109 | 106 | | |
110 | 107 | | |
111 | | - | |
| 108 | + | |
112 | 109 | | |
113 | 110 | | |
114 | 111 | | |
| |||
266 | 263 | | |
267 | 264 | | |
268 | 265 | | |
269 | | - | |
| 266 | + | |
270 | 267 | | |
271 | 268 | | |
272 | 269 | | |
| |||
339 | 336 | | |
340 | 337 | | |
341 | 338 | | |
342 | | - | |
| 339 | + | |
343 | 340 | | |
344 | 341 | | |
345 | 342 | | |
| |||
398 | 395 | | |
399 | 396 | | |
400 | 397 | | |
401 | | - | |
| 398 | + | |
402 | 399 | | |
403 | 400 | | |
404 | 401 | | |
| |||
408 | 405 | | |
409 | 406 | | |
410 | 407 | | |
411 | | - | |
| 408 | + | |
412 | 409 | | |
413 | 410 | | |
414 | 411 | | |
| |||
417 | 414 | | |
418 | 415 | | |
419 | 416 | | |
420 | | - | |
| 417 | + | |
421 | 418 | | |
422 | 419 | | |
423 | 420 | | |
| |||
447 | 444 | | |
448 | 445 | | |
449 | 446 | | |
450 | | - | |
| 447 | + | |
451 | 448 | | |
452 | 449 | | |
453 | 450 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
14 | | - | |
15 | 14 | | |
16 | 15 | | |
17 | 16 | | |
| |||
207 | 206 | | |
208 | 207 | | |
209 | 208 | | |
210 | | - | |
| 209 | + | |
211 | 210 | | |
212 | 211 | | |
213 | 212 | | |
| |||
226 | 225 | | |
227 | 226 | | |
228 | 227 | | |
229 | | - | |
230 | | - | |
231 | | - | |
232 | | - | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
233 | 231 | | |
234 | 232 | | |
235 | 233 | | |
| |||
0 commit comments