Skip to main content

Like print, but also writes to Redis Streams!

Project description

Lazy Redis Log

Like print(...), but also writes to Redis Streams.

Installation

pip install lazy-redis-log

How to Use

from redis import Redis
from lazy_redis_log import LazyRedisLog

LOG = LazyRedisLog()

LOG.redis = Redis(...)
LOG.key = 'logs:example'
LOG.field = 'example'
LOG.do_console = True # Print on the console.
LOG.do_redis = True # Write to Redis.

LOG('Hello World!')

LOG(
    'Hello World!',
    redis=False, # Don't write to Redis.
)

LOG(
    'Hello World!',
    console=False, # Don't print on the console.
)

LOG(
    'Hello World!',
    field='example2'
    # Write on this field on the stream.
    # This will always write to Redis,
    # even if `do_redis` is `False`.
)

LOG(
    'Hello',
    'World!',
    LazyRedisLog,
    sep=', ',
    end=' END ',
    # Functions similarly to `print(...)`.
)

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

lazy_redis_log-0.1.3.tar.gz (1.7 kB view details)

Uploaded Source

Built Distribution

lazy_redis_log-0.1.3-py3-none-any.whl (2.3 kB view details)

Uploaded Python 3

File details

Details for the file lazy_redis_log-0.1.3.tar.gz.

File metadata

  • Download URL: lazy_redis_log-0.1.3.tar.gz
  • Upload date:
  • Size: 1.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.2 CPython/3.8.10 Linux/5.15.0-100-generic

File hashes

Hashes for lazy_redis_log-0.1.3.tar.gz
Algorithm Hash digest
SHA256 4b3c22f995051b66ca1e9b7121cf155204400c5f466e954e46593e0d5cd11e14
MD5 50c88b952f0ef856a06f367f69611f9e
BLAKE2b-256 54f927e6c8bbdefb5c8e8c395de4f0d7afc095a12947049812321cd9a8dc2f92

See more details on using hashes here.

File details

Details for the file lazy_redis_log-0.1.3-py3-none-any.whl.

File metadata

  • Download URL: lazy_redis_log-0.1.3-py3-none-any.whl
  • Upload date:
  • Size: 2.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.2 CPython/3.8.10 Linux/5.15.0-100-generic

File hashes

Hashes for lazy_redis_log-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 77384bb95fa770ab75b0b307116189b841a43dbd9238cf32644428cb3c66d5b7
MD5 349405b035b747a6349480586a7a75d1
BLAKE2b-256 75fd2a5cc34c54cca0bb580c0018dd2c6a40888f7338b21fccb4935811f3f7b6

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page