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 harvestersFileHarvester, SocketHarvester, 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 💪.

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.0.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.0.0-cp313-cp313-manylinux_2_28_aarch64.whl (1.7 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.28+ ARM64

loglite-1.0.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.0.0-cp312-cp312-manylinux_2_28_aarch64.whl (1.7 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.28+ ARM64

loglite-1.0.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.0.0-cp311-cp311-manylinux_2_28_aarch64.whl (1.7 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.28+ ARM64

loglite-1.0.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.0.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.0.0-cp313-cp313-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for loglite-1.0.0-cp313-cp313-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 ae373a411f003384ef50d366dee702b9a8f71a0eefd02daaa48d5afa8778422c
MD5 6ef598d22a28b63f53b6d3df9733693f
BLAKE2b-256 8f672822034ec08197bef250ee721d6b433e16c89b67b8b94e9e6e2674352c37

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for loglite-1.0.0-cp313-cp313-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 f0723fb39cf58bec85a86fd950c907033c88be86afb23e5188551e436aeec5e3
MD5 2c9738f00a52f546e84d57ec8d042b61
BLAKE2b-256 ad09aca0ce6518c7d8d07bc0d12c48f97d8ab2782cd9db4d5c614d7120a04c86

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for loglite-1.0.0-cp312-cp312-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 d010e70f7fdb32039354612ee5f1ad7ff26aad4f567205b2255db93871557a40
MD5 9cf8cb060e73c951a3317980975beded
BLAKE2b-256 796c1631c84a9128d180143f6c551af890fdb51a344ded18d29057ed587fb7c8

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for loglite-1.0.0-cp312-cp312-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 7717956a2f45e1580470c84e4bad11ecb4ba83b32ea85e573ff6f2f159841216
MD5 5fb5d7e455f0b0e7da2920e9f718e32a
BLAKE2b-256 56ac45c988061f67e3bfbcc6d304381aac3c8be6820db48f6c71a673a2f7b34c

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for loglite-1.0.0-cp311-cp311-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 6eb17163acb13acf55e4bb57ee533f81cd7558f9b39aaba0a981602983733486
MD5 e184b360d81846cfb8711a8b205534a9
BLAKE2b-256 e6d57143c1a9de01e470230aae04625035211150eb535ae9d6e2ab4f1d8ba1d1

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for loglite-1.0.0-cp311-cp311-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 b480d65acd4135e5f736b3149cb7749204040f7c7be589d01297f6db969d3335
MD5 d2dbae4deb1fbd5347308df55dd7bf09
BLAKE2b-256 050972e303fea083e912cdb46f462559ccacfaf93bba4caf80edfb099812a0bc

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for loglite-1.0.0-cp310-cp310-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 6e10653ac55b1c2cd22e118ad58f3ece5b4f782cc1c445b391fb7b8124c32646
MD5 d40a24be536dc9570d075a6d51c86b91
BLAKE2b-256 51b8ea7cdae89f2b96a5bbc3861296e85723fc4546892bcdf918628384fcc1be

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for loglite-1.0.0-cp310-cp310-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 d64e44bdf9dd8fbabb6dd4d99189fa359124162d4095affbf488248574494891
MD5 c6add6d357c92a23c6328fca5e6e7b73
BLAKE2b-256 68f2bd02a28792f4f8ac1c5050f2c47af9ef9b7c93152108d16a5c6a228de147

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