| name | unified-logging |
| description | Guide and workflow for Unified Logging. Use when you need Unified Logging. |
Unified Logging
Purpose: All Python files in mvp_site/ MUST use the unified logging module.
Required Pattern
from mvp_site import logging_util
logging_util.info("message")
logging_util.warning("something concerning")
logging_util.error("something failed")
logging_util.debug("debug info")
Forbidden Pattern
import logging
logger = logging.getLogger(__name__)
logger.info("message")
Benefits
- Unified output to both GCP Cloud Logging (stdout) and local file
- Automatic log file path:
/tmp/<repo>/<branch>/<service>.log
- Consistent emoji formatting for errors and warnings
- Single initialization point - no duplicate handlers
Exceptions
Test files (mvp_site/tests/*) may use direct logging.