This module provides a structured and flexible way to log events in your MapAction applications. It includes a Streamlit dashboard for visualizing and filtering log data.
- Status Codes: Uses an
Enum
to define clear status codes. - Detailed Logging: Captures timestamps, country, task name, status code, log message, and additional data.
- Database Storage: Logs events to a SQLite database.
- Integration with Python's
logging
: Uses the built-inlogging
module. - Streamlit Dashboard: Visualize and filter log data.
pip install mapaction-logging-module
1. Logging events:
from mapaction_logging import log_event, StatusCode
log_event(
country="BLZ",
task_name="my_task",
status_code=StatusCode.SUCCESS,
log_message="Task completed successfully!",
additional_data={"details": "Some extra information"}
)
2. Running the dashboard:
streamlit run mapaction_logging/dashboard/mapaction_logging_app.py
Contributions are welcome! See the GitHub repository for more details.
MIT License