Skip to main content

Lightweight log service — Python CLI and harvester layer over the loglite C++ core

Project description

Loglite (Python)

The Python package is a thin convenience layer on top of the loglite C++ core. It provides:

  • CLI (loglite server run, loglite migrate rollout/rollback) — delegates directly to the C++ server via a pybind11 extension (_core).
  • Built-in harvestersSocketHarvester and (optional) ZMQHarvester.
  • Custom harvesters — subclass loglite.Harvester[Config] to write custom log ingestors in Python. Ingested entries are pushed directly into the C++ server's backlog in the same process.

The C++ core handles everything else: the HTTP server, SQLite read/write, migrations, SSE, and vacuuming. The Python package adds zero server-side overhead.

Installation

Pre-built wheels are published to PyPI:

pip install loglite

# With ZeroMQ harvester support
pip install "loglite[zmq]"

Writing a custom harvester

from dataclasses import dataclass
from loglite.harvesters.base import BaseHarvesterConfig, Harvester

@dataclass
class MyConfig(BaseHarvesterConfig):
    source: str

class MyHarvester(Harvester[MyConfig]):
    async def run(self):
        while self._running:
            log = await fetch_from_somewhere(self.config.source)
            self.ingest(log)  # pushes into the C++ backlog, thread-safe

Register it in your YAML config:

harvesters:
  - type: myapp.harvesters.MyHarvester
    name: my-source
    config:
      source: "tcp://localhost:5000"

Local development

Prerequisites

  • uv
  • Conan 2pip install conan && conan profile detect
  • CMake ≥ 3.25
  • A C++20-capable compiler (GCC 12+, Clang 16+, or Homebrew LLVM on macOS)

Build

cd py
uv sync --all-groups

That's it. CMake automatically invokes Conan during the configure step, so no separate Conan command is needed. The first sync compiles the C++ dependencies (SQLite3, Boost headers, yaml-cpp); subsequent syncs use Conan's binary cache and are fast 💪.

For building docs

uv run --group docs sphinx-build -W --keep-going -b html ../docs ../docs/_build/html

Running tests

cd py
uv run pytest                    # all tests
uv run pytest tests/test_cli.py  # single file

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

loglite-1.3.0-cp313-cp313-manylinux_2_28_x86_64.whl (1.8 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.28+ x86-64

loglite-1.3.0-cp313-cp313-manylinux_2_28_aarch64.whl (1.7 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.28+ ARM64

loglite-1.3.0-cp312-cp312-manylinux_2_28_x86_64.whl (1.8 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.28+ x86-64

loglite-1.3.0-cp312-cp312-manylinux_2_28_aarch64.whl (1.7 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.28+ ARM64

loglite-1.3.0-cp311-cp311-manylinux_2_28_x86_64.whl (1.8 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.28+ x86-64

loglite-1.3.0-cp311-cp311-manylinux_2_28_aarch64.whl (1.7 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.28+ ARM64

loglite-1.3.0-cp310-cp310-manylinux_2_28_x86_64.whl (1.8 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.28+ x86-64

loglite-1.3.0-cp310-cp310-manylinux_2_28_aarch64.whl (1.7 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.28+ ARM64

File details

Details for the file loglite-1.3.0-cp313-cp313-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for loglite-1.3.0-cp313-cp313-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 95def5389f194504ec07549a1eaa62892de9117376ac2fcdacb4116c3db33dc5
MD5 d726fdf3b0e562141495138dc42e035e
BLAKE2b-256 f3102b7d3e869d0d23c01bb796ddbfaf238c0b1b07af709f19d52939941e46fa

See more details on using hashes here.

File details

Details for the file loglite-1.3.0-cp313-cp313-manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for loglite-1.3.0-cp313-cp313-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 2b753ab9196043b7b82787dd7019423e46417b221af3fc925b9afc90669c2c33
MD5 66a55df2246419a51335295093c2eb55
BLAKE2b-256 79ed1ce99ada69d6736ca60ac048186e5205ba53df821f81545b35f512ac6ed5

See more details on using hashes here.

File details

Details for the file loglite-1.3.0-cp312-cp312-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for loglite-1.3.0-cp312-cp312-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 63c0172c9aca10ed458ce01e71a27d912a17033a95eb3c6fe2340d48a7bdab33
MD5 a374f39e35cdc9ec5f07037105bca736
BLAKE2b-256 cc257ce9236b60edfa04d07a27ed042cec7639f19e594aa97a1a0d484488739b

See more details on using hashes here.

File details

Details for the file loglite-1.3.0-cp312-cp312-manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for loglite-1.3.0-cp312-cp312-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 e5b28555f6be8476e4adf0288c5984c70bd859cfc77d90ed14e3604fced2043d
MD5 fb46cd56e477e782d46d68beaef6fca4
BLAKE2b-256 00118571f63b0a5a757a35dfcff311891219997f710a21a78a3d707e44a0e1d3

See more details on using hashes here.

File details

Details for the file loglite-1.3.0-cp311-cp311-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for loglite-1.3.0-cp311-cp311-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 536e1258ffcefb85f5954fc3840eb155b9c6868f5ea2cd65dd39832da643cdda
MD5 4ff87c24582f5e9fb993241fe9668fab
BLAKE2b-256 da09b7b294eb395a3a437e71d23369814b9a2269d7f87321d620d86f8083e51e

See more details on using hashes here.

File details

Details for the file loglite-1.3.0-cp311-cp311-manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for loglite-1.3.0-cp311-cp311-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 00d7fc512ed389c05f21f56da05b1a0cfb3baed281c47a2b8cf7980569b6baa8
MD5 fb326f3c59388b7045cdc3fa8a4b797f
BLAKE2b-256 6b489fca3c162b7fe746cc6d373fb4bb7c16e08ad9c2a45463722a11ebf685dd

See more details on using hashes here.

File details

Details for the file loglite-1.3.0-cp310-cp310-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for loglite-1.3.0-cp310-cp310-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 c7d240c813ec326150c636b53ebc96197b11a7c5fb26b2186c69beae767edac5
MD5 89ebb3c0ddf04205b1535b33b0c4cc1e
BLAKE2b-256 89e8ff6f38998d75f0911eebcf6927fdd5cbd7cc7bc55797c9feae6b5109b349

See more details on using hashes here.

File details

Details for the file loglite-1.3.0-cp310-cp310-manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for loglite-1.3.0-cp310-cp310-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 ce9cd1d710efe7cee290dd46e966ea1b223dbe3b85c84f4d0b7f8cfa960b1bcb
MD5 5fd83f798ed52288da003dd4033c0322
BLAKE2b-256 3f56d8c806e2490387c24a050052d60dd1987534127fb41c322e168c218da825

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page