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.1.2.tar.gz (3.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.1.2-py3-none-any.whl (3.8 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: colorstreak-2.1.2.tar.gz
  • Upload date:
  • Size: 3.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.17 {"installer":{"name":"uv","version":"0.9.17","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.1.2.tar.gz
Algorithm Hash digest
SHA256 47d9863f830d36caa6a4a1e4743de918c18667107c920e67e50ddb98c813f8e5
MD5 fcb4f6f2f4ece9dfcff1f46a97530aa7
BLAKE2b-256 007e0ff67220c078d98b19759fafeb90ef56ad6ffa18da773b2609091bd86047

See more details on using hashes here.

File details

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

File metadata

  • Download URL: colorstreak-2.1.2-py3-none-any.whl
  • Upload date:
  • Size: 3.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.17 {"installer":{"name":"uv","version":"0.9.17","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.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 14be0da23395eff3154a4cf62aeeef1f2be67e94215649ddb3138e2b0f30de95
MD5 49118b1b089d05b06a70dd614aee10c4
BLAKE2b-256 80ab52107d3da9a82c3136efeedc4a3c78eb688dc48346bbf1a7a4731e334700

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