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.2.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.2.0-cp313-cp313-manylinux_2_28_aarch64.whl (1.8 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.28+ ARM64

loglite-1.2.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.2.0-cp312-cp312-manylinux_2_28_aarch64.whl (1.8 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.28+ ARM64

loglite-1.2.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.2.0-cp311-cp311-manylinux_2_28_aarch64.whl (1.8 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.28+ ARM64

loglite-1.2.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.2.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.2.0-cp313-cp313-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for loglite-1.2.0-cp313-cp313-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 4b09a2625868d75ec738db583b8472699a88453fea09f3eed2bcde2ecd32e8c2
MD5 de281b119b23136608905bc26788855e
BLAKE2b-256 00896de66e21a5b741bb75c71880823aecf0b0c2bc69fab9724e65d92befe21f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for loglite-1.2.0-cp313-cp313-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 f8b222df987238e0b4ffbd286741485a7fe49be2bca9cfed94fe6f1d396473b2
MD5 0395656ed69fe0522e35e61a02fa156d
BLAKE2b-256 1b0989c136067c4c6bf43e0a26c40375fdad26dee8fbce7285c4095d65a56bb3

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for loglite-1.2.0-cp312-cp312-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 ee6b0c891a7e89a3a3a78ad6d98c7646f514e80f25e7ccef458ba1718a62af50
MD5 67df871b2121f4e0e9647fbb43a720b8
BLAKE2b-256 01a9a9b57820ae7b0d31f58280d00a2ebaba051f69b2c53bd53e0463568fc469

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for loglite-1.2.0-cp312-cp312-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 c9f52f3de1485dea73ed3995c5b02335389d5239a82d529c4bd280d2aceed36d
MD5 45a6a0ef3f3fa3914fd564292ba7aebc
BLAKE2b-256 7d6696b423d4bac06fa5471d53e5df32428c567379078c958b619a6cfcab5106

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for loglite-1.2.0-cp311-cp311-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 2857c50c3c31fad9ead2651cbfed20952351552d3c790115362454126b96e48b
MD5 54a7d832074d1dbdaa17a003a886b54f
BLAKE2b-256 59049c685c4b661aad06a439a29b9704aaa9962a427833a1a38accb706eed863

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for loglite-1.2.0-cp311-cp311-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 a968e9d06b6726879fb5e4958f226d3adcc372fc27c9849e291c5f372c5b5df3
MD5 ead8126c1e3d0b51ee7247c84066daa9
BLAKE2b-256 a3e2cccde7d779289aded2644203acee39ba1f22d27536485f74e5b58ab2c5b0

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for loglite-1.2.0-cp310-cp310-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 f6c49e67860a43f122524cf4eb6ffb42e9fcfe8f7d93e2cfa66b5878470e9053
MD5 d65b05bab966ad8b8dd8066944481e5c
BLAKE2b-256 9888f6ccc5bd23750956127c197cb99f0d5b2a788babbbe9309a7044af48fa56

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for loglite-1.2.0-cp310-cp310-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 67b9667feaee3bff72a92a7c9256693fcc4a804160989e6c55f672b1fc87730e
MD5 1d9afe83fee0bbdeca6106d9e91bc989
BLAKE2b-256 3ec643afa611ebe7d7ba8a74b311740606f62248985ec05256a3f9933cc1e909

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