Skip to main content

Centralized logging utilities for InstruktAI Python services.

Project description

instruktai-python-logger

Centralized logging utilities for InstruktAI Python services.

This repo provides a shared, consistent logging contract (env vars + output format + log location) intended to keep logs highly queryable (including by AIs that only read a tail window).

Background and rationale live in docs/design.md. Publishing notes live in docs/publishing.md.

Install (editable, local workspace)

From PyPI (recommended):

pip install instruktai-python-logger

From GitHub:

pip install git+ssh://git@github.com/InstruktAI/python-logger.git

API

  • Python entrypoint: instrukt_ai_logging.configure_logging(...)
  • Logger helper: instrukt_ai_logging.get_logger(name) (named **kv logging)
  • CLI entrypoint: instrukt-ai-logs (reads recent log lines)

Example:

import logging
from instrukt_ai_logging import configure_logging

configure_logging(name="teleclaude", app_logger_prefix="teleclaude")
logger = logging.getLogger("teleclaude.core")
logger.info("job_started", job_id="abc123", user_id=123)

Environment variables (contract)

Per-app prefix model (example uses TELECLAUDE_):

  • TELECLAUDE_LOG_LEVEL
  • TELECLAUDE_THIRD_PARTY_LOG_LEVEL
  • TELECLAUDE_THIRD_PARTY_LOGGERS (comma-separated logger prefixes, e.g. httpcore,telegram)

Global:

  • INSTRUKT_AI_LOG_ROOT (optional log root override)

Log location (contract)

Default target:

  • /var/log/instrukt-ai/{app}/{app}.log

The installer for each service is expected to create the directory and set write permissions for the daemon user. If the default location is not writable, the implementation will fall back to a user-writable directory and/or require INSTRUKT_AI_LOG_ROOT.

Project details


Download files

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

Source Distribution

instruktai_python_logger-0.1.2.tar.gz (8.4 kB view details)

Uploaded Source

Built Distribution

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

instruktai_python_logger-0.1.2-py3-none-any.whl (8.6 kB view details)

Uploaded Python 3

File details

Details for the file instruktai_python_logger-0.1.2.tar.gz.

File metadata

File hashes

Hashes for instruktai_python_logger-0.1.2.tar.gz
Algorithm Hash digest
SHA256 2827d5c047749b9f07ea26db5f5cbea28e7475634a949ffd0fd43bbe7a27e69c
MD5 f157bb0d06bbeb7a2389cdc7a9cdd6da
BLAKE2b-256 c8019e00ea531350b5cd559af814dab3e23e292c034d4560e2c1325575c2d847

See more details on using hashes here.

File details

Details for the file instruktai_python_logger-0.1.2-py3-none-any.whl.

File metadata

File hashes

Hashes for instruktai_python_logger-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 f7bd235fc5025ae106ad5ca29e16a5472bb922c20f6112b3defa43565637d2cb
MD5 9095a6c938008d27c23733ebde43f26d
BLAKE2b-256 7cd0562a4395bbcd87baef348869a80326a4e1b99ee13ede63e12b1c040083cc

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