Skip to main content

Real-time log streaming SDK for Python

Project description

slogx

Real-time log streaming SDK for Python. (Read more on GitHub!)

Installation

pip install slogx

Usage

import os
from slogx import slogx

# Start the log server (is_dev prevents accidental prod use)
slogx.init(
    is_dev=os.environ.get('ENV') != 'production',
    port=8080,
    service_name='my-service'
)

# Log anywhere in your app
slogx.info("Server started", {"env": "dev"})
slogx.debug("Debug info", {"key": "value"})
slogx.warn("Warning message")
slogx.error("Error occurred", {"code": 500})

CI Mode

In CI environments, you can write logs to a file instead of starting a WebSocket server. CI mode is auto-detected via common CI env vars, or can be forced explicitly.

import os
from slogx import slogx

slogx.init(
    is_dev=True,
    service_name='my-service',
    ci_mode=True,
    log_file_path='./slogx_logs/my-service.ndjson',
    max_entries=10000
)

slogx.info("CI log entry", {"ok": True})

Features

  • WebSocket-based real-time log streaming
  • Structured logging with metadata (file, line, function)
  • Stack trace capture for all log levels
  • Zero-config setup for local development

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

slogx-0.0.2.tar.gz (1.8 kB view details)

Uploaded Source

Built Distribution

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

slogx-0.0.2-py3-none-any.whl (1.7 kB view details)

Uploaded Python 3

File details

Details for the file slogx-0.0.2.tar.gz.

File metadata

  • Download URL: slogx-0.0.2.tar.gz
  • Upload date:
  • Size: 1.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.7.19

File hashes

Hashes for slogx-0.0.2.tar.gz
Algorithm Hash digest
SHA256 5d240e441b564ee6ebf524de8e8fdecb59df15ea202d52834e8af7f320ac0109
MD5 ec5cbfc405d73eaf53e30127eab8b740
BLAKE2b-256 84fc98a414aa072a4addfd50960f383eb73f7d03188c31fdbd07e8936cb2cb11

See more details on using hashes here.

File details

Details for the file slogx-0.0.2-py3-none-any.whl.

File metadata

  • Download URL: slogx-0.0.2-py3-none-any.whl
  • Upload date:
  • Size: 1.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.7.19

File hashes

Hashes for slogx-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 81d2631dce2ff95dd65115bd424496bf981414857803fce315cfe31e62c70ee7
MD5 ca481e575354582f2ff7531e4a05b90b
BLAKE2b-256 0410e291d635469b38bf1af2760333b2cc504dc518b78edb12bbae1d63eb9c9c

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