Skip to main content

stellarmesh-logging

stellarmesh-logging 为 Python 3.11 及以上项目提供 Logging v1 严格模型、标准库 logging.Handler、结构化日志门面和有界异步批量 HTTP 客户端。

python -m pip install stellarmesh-logging==0.1.2
import logging

from stellarmesh_logging import Client, ClientConfig, StellarmeshHandler

client = Client(
    ClientConfig(
        base_url="http://logging-service:8091",
        token="由业务配置层注入",
        service="example-worker",
    )
)
logger = logging.getLogger("example")
logger.addHandler(StellarmeshHandler(client))
logger.info("job started", extra={"job_id": "job-123"})

client.close(timeout=10.0)

客户端只在内存中排队日志,不提供本地持久 spool。日志调用成功只表示事件已经进入本地队列;收到 logging-service 的合法 202 后,才表示 Kafka 或服务端持久 spool 已经确认。网络结果不确定时可能产生重复事件,链路按 at-least-once 边界设计。

service 必须非空且没有首尾空白。token 只发送给 logging-service,metadata 会限制深度、数量和字符串长度,并对规范化后的敏感 key 脱敏。应用退出前应显式调用 close()aclose(),并通过 drop_handler 观测队列满、校验失败、发送失败和关闭超时。

完整配置、标准 Handler、trace 传播、重试和关闭语义见项目中的 docs/sdk/python/README.md

Download files

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

Source Distribution

stellarmesh_logging-0.1.2.tar.gz (20.1 kB view details)

Uploaded Source

Built Distribution

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

stellarmesh_logging-0.1.2-py3-none-any.whl (17.1 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: stellarmesh_logging-0.1.2.tar.gz
  • Upload date:
  • Size: 20.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for stellarmesh_logging-0.1.2.tar.gz
Algorithm Hash digest
SHA256 01824776dfab6747b1dac1b2053eeff5cae2723e63de871ac3090ce7d64800ab
MD5 e025104f831604d66a4ff3a42ae96645
BLAKE2b-256 d8d03e09b24a970e04505359527d5d307e8c469200941c79813eeebfcaf7b41d

See more details on using hashes here.

Provenance

The following attestation bundles were made for stellarmesh_logging-0.1.2.tar.gz:

Publisher: release-python.yml on L1ndenbaum/stellarmesh-sdk

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

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

File metadata

File hashes

Hashes for stellarmesh_logging-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 77d65f47f1100dc6fcfa415a9fd287364fa90579c218eee9f780fe26e413e117
MD5 66874e39d19a86ebea7cd72a2ae0256a
BLAKE2b-256 2bfe1006fb7cf015edf2717bc4c899b6570b2bca2b42ac27efd189d2f78ab2ec

See more details on using hashes here.

Provenance

The following attestation bundles were made for stellarmesh_logging-0.1.2-py3-none-any.whl:

Publisher: release-python.yml on L1ndenbaum/stellarmesh-sdk

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

0.4.0

2 files

0.3.0

2 files

0.2.0

2 files

This release

0.1.2 This release

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page