← Back to list

logging-patterns
by andyngdz
ExoGen Backend
⭐ 2🍴 0📅 Dec 19, 2025
SKILL.md
name: logging-patterns description: Use when adding logging to features - structured logging with LoggerService categories
Logging Patterns
Use this skill when implementing features that need logging or debugging.
Checklist
Setup Logger
- Import LoggerService:
from app.services import logger_service - Get logger with category:
logger = logger_service.get_logger(__name__, category='[Category]') - Verify category matches feature domain (see categories below)
Select Appropriate Category
Choose the category that matches your feature domain:
-
[ModelLoad]- Model loading operations -
[Download]- Download operations -
[Generate]- Image generation -
[API]- API endpoints -
[Database]- Database operations -
[Service]- Service layer operations -
[Socket]- WebSocket events -
[GPU]- GPU operations
Use Appropriate Log Level
-
.debug()- Detailed diagnostic information (only visible withLOG_LEVEL=DEBUG) -
.info()- General informational messages (progress, status updates) -
.warning()- Warning messages (degraded functionality, deprecated usage) -
.error()- Error messages (failures that don't stop execution) -
.exception()- Exceptions with full stack traces (use in except blocks)
Example Usage
from app.services import logger_service
logger = logger_service.get_logger(__name__, category='ModelLoad')
def load_model(model_path: str):
logger.info(f'Loading model from {model_path}')
try:
# ... model loading logic
logger.debug('Model loaded successfully')
except FileNotFoundError as error:
logger.error(f'Model file not found: {error}')
raise
Configuration
- Test with debug logging:
LOG_LEVEL=DEBUG uv run python main.py - Verify logs appear with correct category prefix in output
Reference
See app/services/logger.py for LoggerService implementation.
Score
Total Score
65/100
Based on repository quality metrics
✓SKILL.md
SKILL.mdファイルが含まれている
+20
✓LICENSE
ライセンスが設定されている
+10
○説明文
100文字以上の説明がある
0/10
○人気
GitHub Stars 100以上
0/15
✓最近の活動
3ヶ月以内に更新
+5
○フォーク
10回以上フォークされている
0/5
✓Issue管理
オープンIssueが50未満
+5
✓言語
プログラミング言語が設定されている
+5
✓タグ
1つ以上のタグが設定されている
+5
Reviews
💬
Reviews coming soon

