logging-patterns
Use when adding logging to features - structured logging with LoggerService categories
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
القائمة
Use when adding logging to features - structured logging with LoggerService categories
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
استنادا إلى تصنيف SOC المهني
Master code organization - encapsulation with wrapper methods, file modularity (split >150 lines), one function one responsibility, descriptive naming, minimal comments
Use when starting work - guidelines for asking questions and commit policies
Use when adding error handling - exception patterns, HTTP codes, domain exceptions
Use when exiting plan mode - where to save implementation plans
Apply Martin Fowler's refactoring patterns - extract variables to eliminate repetition, split temporary variables, replace temp with query for cleaner, more maintainable code
Use when writing tests - test structure, mocking patterns, pre-commit checks
| name | logging-patterns |
| description | Use when adding logging to features - structured logging with LoggerService categories |
Use this skill when implementing features that need logging or debugging.
from app.services import logger_servicelogger = logger_service.get_logger(__name__, category='[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.debug() - Detailed diagnostic information (only visible with LOG_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)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
LOG_LEVEL=DEBUG uv run python main.pySee app/services/logger.py for LoggerService implementation.