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.1.0-cp313-cp313-manylinux_2_28_x86_64.whl (1.9 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.28+ x86-64

loglite-1.1.0-cp313-cp313-manylinux_2_28_aarch64.whl (1.8 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.28+ ARM64

loglite-1.1.0-cp312-cp312-manylinux_2_28_x86_64.whl (1.9 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.28+ x86-64

loglite-1.1.0-cp312-cp312-manylinux_2_28_aarch64.whl (1.8 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.28+ ARM64

loglite-1.1.0-cp311-cp311-manylinux_2_28_x86_64.whl (1.9 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.28+ x86-64

loglite-1.1.0-cp311-cp311-manylinux_2_28_aarch64.whl (1.8 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.28+ ARM64

loglite-1.1.0-cp310-cp310-manylinux_2_28_x86_64.whl (1.9 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.28+ x86-64

loglite-1.1.0-cp310-cp310-manylinux_2_28_aarch64.whl (1.8 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.28+ ARM64

File details

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

File metadata

File hashes

Hashes for loglite-1.1.0-cp313-cp313-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 c7b6da836f5a8c6525721ad79c2ef406fb19f5afeea4a4178a045b497e0e8c31
MD5 cdfbfe1cf62e5e05099ac3a0467f08e3
BLAKE2b-256 498bda76f9cc9e18f7089fab2e89e3935c901fc8f456afae1ff3aef9747b7c87

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for loglite-1.1.0-cp313-cp313-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 fd4520ccf772f6f3a26f0176346820b97f773a4a601571a8dc96ccd68b9f9f06
MD5 5a39e977ff067bb5a5d9bf43a3dfaf31
BLAKE2b-256 11f5cde50325c12d25f7d21b8104e7b4cb2576c561f28733eaaa1a9e326f04f0

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for loglite-1.1.0-cp312-cp312-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 f1cce05aafcfcfcef77de70792e6822570066bab2303d21346ddcded105c932c
MD5 3980061382dbf58e018570c26972905d
BLAKE2b-256 a2f810a5b9a064d6acc1b645f5298caf73e73667293320cb3dd469b4679b78a5

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for loglite-1.1.0-cp312-cp312-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 d97a920c34e7f23155a8384c6ee282d74e16688e65e75115dcaf744328727f91
MD5 a621fa52cc0986136f09f854cdbcca08
BLAKE2b-256 3d773953ff255c023106584ef3e9ffd8d264b37994088bee2c44d23720229fa6

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for loglite-1.1.0-cp311-cp311-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 82463c08b9126ee3e5e870cf3857c8b1dfb246dc61c354c7d2f8a3ce05dc3dc4
MD5 099c4237e4d287b8ae85c8598da6608e
BLAKE2b-256 1c0a64f2f1f3406470f1e37cf3e56e1c23d8ffe3e36bc2754b836faa78ce7686

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for loglite-1.1.0-cp311-cp311-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 45f3bca13c50c58037b735684c4af0f5b8ea7f47c6d1ae6a72c226d34d7b9de1
MD5 710e0027e05a65c75ad54912bc15f21e
BLAKE2b-256 a8479af3eff189143084b2b9a8069be6670f95189da66a314a6ca772620dc8a9

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for loglite-1.1.0-cp310-cp310-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 efc7a714b099b43f40526be08e8088086eb66b06259985235fb3befeb4072aab
MD5 4b0e5102a0ecbb400bba65adf5052f70
BLAKE2b-256 8f68b82c50fa297294c3352b245dc2653dad7d521095bcfb3053f5fd657d69e9

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for loglite-1.1.0-cp310-cp310-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 3d773171ded4ab9c6109ccecbe52752f9695053b4d70ad4c5915145a2a16ea78
MD5 9ec0a708240cf759ef396c9065262654
BLAKE2b-256 59adf5b365cf507390ad8fefe0041a7c2ca505d4e712a9145c3d25d4157c06d7

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