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

Uploaded Python 3

File details

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

File metadata

  • Download URL: colorstreak-2.1.3.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.3.tar.gz
Algorithm Hash digest
SHA256 14734e23767db8fe62eb0622666474072da6826a77e67268159676e49085174d
MD5 bc820b363e5cd92d14212616ed9a5c12
BLAKE2b-256 1af62d94dcb1861ba4b92a062dac8840d51258efe13bf46fa7450ffbf5331c9a

See more details on using hashes here.

File details

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

File metadata

  • Download URL: colorstreak-2.1.3-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.3-py3-none-any.whl
Algorithm Hash digest
SHA256 bd3f915ca7c2fdded36e3dc91153b530571c57002c16766c66f9fc904f6b19aa
MD5 b838416b8cfb0a019f54472579a8067e
BLAKE2b-256 abefe89ee4b3c3c2dda94c3621b3ccd0ea8a73d1654e733dd999d1eadf881117

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