Skip to content

This package provides a structured and flexible way to log events in your application, including the ability to store logs in a database for later analysis.

License

Notifications You must be signed in to change notification settings

mapaction/mapaction_logging_module

Repository files navigation

MapAction Logging Module

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.

Features

  • 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-in logging module.
  • Streamlit Dashboard: Visualize and filter log data.

Installation

pip install mapaction-logging-module

Usage

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

Contributing

Contributions are welcome! See the GitHub repository for more details.

License

MIT License

About

This package provides a structured and flexible way to log events in your application, including the ability to store logs in a database for later analysis.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •  

Languages