Skip to main content

Minimal color logger for Python terminals (print-compatible)

Project description

colorstreak

colorstreak es una mini-lib para imprimir logs en la terminal con colores ANSI, sin acoplarte a un framework de logging. La API está pensada para sentirse como print() (acepta sep, end, file, flush) pero con niveles semánticos.

¿Qué resuelve?

  • Salida de terminal más legible (debug/info/warning/error/success, etc.).
  • Un prefijo consistente por nivel (ej: [INFO]).
  • Control simple del estilo (solo prefijo, todo coloreado, o “soft”).
  • Compatibilidad con NO_COLOR para desactivar colores.

Instalación

pip install colorstreak

Uso rápido

from colorstreak import Logger

Logger.info("Servidor arriba")
Logger.warning("Cache fría")
Logger.error("No se pudo conectar")
Logger.success("Deploy OK")

Estilos

Hay 3 estilos de salida:

  • full (default): prefijo y mensaje coloreados
  • prefix: solo el prefijo coloreado
  • soft: prefijo resaltado y mensaje atenuado

Configúralo en runtime:

from colorstreak import Logger

Logger.configure(style="soft")

O por variable de entorno:

export COLORSTREAK_STYLE=prefix

Desactivar colores

Si tu entorno no soporta ANSI o quieres logs “planos”, usa NO_COLOR:

export NO_COLOR=1

Niveles disponibles

Base:

  • Logger.debug()
  • Logger.info()
  • Logger.warning()
  • Logger.error()
  • Logger.library()
  • Logger.success()

Helpers:

  • Logger.step()
  • Logger.note()
  • Logger.title()
  • Logger.metric()

Compatible con print()

Cada método acepta sep=, end=, file=, flush= igual que print():

from colorstreak import Logger

Logger.info("Multiple", "args", 123, sep=" | ")
Logger.warning("Sin salto...", end="")
Logger.warning(" <- continúa")

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

colorstreak-2.2.0.tar.gz (14.5 kB view details)

Uploaded Source

Built Distribution

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

colorstreak-2.2.0-py3-none-any.whl (11.5 kB view details)

Uploaded Python 3

File details

Details for the file colorstreak-2.2.0.tar.gz.

File metadata

  • Download URL: colorstreak-2.2.0.tar.gz
  • Upload date:
  • Size: 14.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.10.12 {"installer":{"name":"uv","version":"0.10.12","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for colorstreak-2.2.0.tar.gz
Algorithm Hash digest
SHA256 4d1edcb3a768cdc17f56cee8f3780b5e84d75729f8e6a5ddf7542cc4dc64ce7f
MD5 07967deca3eb63bf9dfdb23cc50408aa
BLAKE2b-256 08b6eb13fdbb900d3ad8f30315a3e1540209b6894c2fb6810b20b9db840b093e

See more details on using hashes here.

File details

Details for the file colorstreak-2.2.0-py3-none-any.whl.

File metadata

  • Download URL: colorstreak-2.2.0-py3-none-any.whl
  • Upload date:
  • Size: 11.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.10.12 {"installer":{"name":"uv","version":"0.10.12","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for colorstreak-2.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 0c3b2142639a3a313009c67057beedfebfb3e44345da1ec00f29a0273a805573
MD5 a6fbc688fe349e4c2b4b826d8ea35de3
BLAKE2b-256 84a48f7608cbe47e2f994de9c911705ef38d03b9d899efa7d762687cbaee9daa

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