Thank you for your interest in contributing to Logly! This guide will help you get started.
- Rust: Latest stable (
rustup update stable) - Python: 3.10+
- uv:
pip install uv - maturin:
cargo install maturin
First, fork the Logly repository on GitHub by clicking the Fork button.
git clone https://github.com/<your-username>/logly.git
cd loglygit remote add upstream https://github.com/muhammad-fiaz/logly.gituv venvuv syncuv run maturin developuv run pre-commit install-
Create a feature branch:
git checkout -b feature/my-feature
-
Ensure all checks pass:
cargo fmt --check cargo clippy --workspace --all-targets -- -D warnings cargo test --workspace ruff check . ruff format --check . uv run pytest -v
-
Rust code (in
crates/):- Follow existing code patterns
- Add tests for new functionality
- Run
cargo fmtbefore committing
-
Python code (in
logly/):- Follow existing code patterns
- Add type hints for new functions
- Run
ruff formatbefore committing
-
Documentation (in
docs/):- Follow existing patterns
- Test locally with
uv run mkdocs serve
# Rust tests
cargo test --workspace
# Python tests
uv run pytest -v
# Specific test file
uv run pytest tests/test_logger.py -v
# With coverage
uv run pytest --cov=logly tests/# Check Rust formatting
cargo fmt --check
# Fix Rust formatting
cargo fmt
# Check Rust lints
cargo clippy --workspace --all-targets -- -D warnings
# Check Python linting
ruff check .
# Fix Python linting
ruff check --fix .
# Check Python formatting
ruff format --check .
# Fix Python formatting
ruff format .# Serve docs locally
uv run mkdocs serve
# Build docs
uv run mkdocs buildlogly/
├── crates/ # Rust crates (monorepo)
│ ├── error/ # Error types
│ ├── config/ # Configuration
│ ├── levels/ # Log levels
│ ├── record/ # Log records
│ ├── color/ # ANSI colors
│ ├── format/ # Formatters
│ ├── filter/ # Filters
│ ├── rotate/ # File rotation
│ ├── compress/ # Compression
│ ├── concurrency/ # Background workers
│ ├── schedule/ # Scheduling
│ ├── context/ # Context management
│ ├── sink/ # Sinks
│ └── core/ # Dispatch engine
├── src/ # PyO3 bindings
├── logly/ # Python package
│ ├── logger.py # Main Logger class
│ ├── models.py # Pydantic config models
│ ├── exceptions.py # Exception hierarchy
│ ├── integrations/ # FastAPI, Django, stdlib, Rich, telemetry
│ └── _logly.pyi # Type stubs
├── tests/ # Python tests
├── examples/ # Usage examples
├── docs/ # Documentation source
└── site/ # Built documentation
- Use
cargo fmtfor consistent formatting - Use
cargo clippyfor lint checks - Add
#[cfg(test)] mod testsfor unit tests - Use
?for error propagation - Document public functions with
///comments
- Use
rufffor linting and formatting - Add type hints for all public functions
- Use
__all__for public API - Add docstrings for public classes and functions
- Use
dataclassorNamedTuplefor simple data structures
- Update documentation if needed
- Add tests for new functionality
- Ensure all checks pass:
cargo fmt --check cargo clippy --workspace --all-targets -- -D warnings cargo test --workspace ruff check . ruff format --check . uv run pytest -v
- Create a pull request with a clear description
- Reference any related issues
- Use the bug report template
- Include steps to reproduce
- Include your environment details
- Use the feature request template
- Explain the use case
- Provide examples if possible
- Use the docs issue template
- Specify which page needs updating
- Provide the corrected content if possible
- Be respectful and inclusive
- Focus on constructive feedback
- Help others learn and grow
- Open a discussion on GitHub
- Use the help wanted template for specific issues