Skip to main content

Arguslog Python SDK — error tracking for server-side Python apps

Project description

arguslog (Python SDK)

Arguslog SDK for Python 3.9+. Zero runtime dependencies — uses stdlib urllib for transport and threading.Thread for the background sender.

Install

pip install arguslog

Quick start

import arguslog

arguslog.init(
    "arguslog://<key>@<host>/api/<projectId>",
    environment="production",
    release="1.2.3",
)

try:
    do_something_risky()
except Exception as exc:
    arguslog.capture_exception(exc)

# Always flush before the process exits — short-lived scripts and CLIs
# will exit before the background sender drains otherwise.
arguslog.flush()

Manual capture

arguslog.capture_message("user signup completed", level="info")
arguslog.set_user({"id": "u-1234", "email": "alice@example.com"})  # email auto-scrubbed
arguslog.set_tag("region", "eu-west")
arguslog.set_context("order", {"id": 42, "total_cents": 9900})
arguslog.add_breadcrumb({"category": "nav", "message": "/cart"})

Integrations

Uncaught exceptions

from arguslog.integrations.excepthook import install_excepthook

install_excepthook(arguslog.get_client())

The wrapper preserves the previous sys.excepthook (so debuggers, IPython, etc. still work) and skips KeyboardInterrupt.

Standard logging module

import logging
from arguslog.integrations.logging import install_logging_handler

install_logging_handler(arguslog.get_client(), level=logging.ERROR)

logging.getLogger(__name__).error("payment failed", exc_info=True)

ERROR-or-higher records with exc_info become capture_exception; everything else at or above the handler's level becomes capture_message.

CLI / script lifecycle

try:
    main()
finally:
    arguslog.flush()   # or arguslog.close() if you want to tear down

Without a flush, a CLI that exits in <1s will likely terminate before the background sender's first request leaves the socket.

Wire format

The on-the-wire JSON shape is identical to @arguslog/sdk-node and org.arguslog:arguslog-java-sdk so all events from a polyglot stack land in the same Arguslog issue groups.

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

arguslog-1.0.0.tar.gz (42.8 kB view details)

Uploaded Source

Built Distribution

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

arguslog-1.0.0-py3-none-any.whl (10.9 kB view details)

Uploaded Python 3

File details

Details for the file arguslog-1.0.0.tar.gz.

File metadata

  • Download URL: arguslog-1.0.0.tar.gz
  • Upload date:
  • Size: 42.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for arguslog-1.0.0.tar.gz
Algorithm Hash digest
SHA256 731edeae26cd5baf9fdadb1cdd899b694af5625852be308cfc7aa8c53beefafb
MD5 747fcf70bc74eed7c779841f0e5fd222
BLAKE2b-256 a752072975c404cd3868645ac3a568aea009cb0ab7873b3b29d666fdd8f22183

See more details on using hashes here.

Provenance

The following attestation bundles were made for arguslog-1.0.0.tar.gz:

Publisher: release-sdk-python.yml on petarnenov/arguslog

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

File details

Details for the file arguslog-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: arguslog-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 10.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for arguslog-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 d7d63864bc68d92aa163df3ee667342a7cb0998cf33780a621a40990897cf1cf
MD5 f9086b4cf2d4086f471eb45420f65588
BLAKE2b-256 7cd7b939f0a69c05579fb12582703fafaaa90dd20b5efe339e06d07d654733fe

See more details on using hashes here.

Provenance

The following attestation bundles were made for arguslog-1.0.0-py3-none-any.whl:

Publisher: release-sdk-python.yml on petarnenov/arguslog

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

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