Skip to main content

Professional colored terminal logger with timestamps, symbols, and title bar support.

Project description

spanlogger

Professional colored terminal logger for Python by rowsvips.

Zero dependencies. Thread-safe. Windows & Linux compatible.

Install

pip install spanlogger

Quick Start

from spanlogger import Logger, Colors

log = Logger(title="MyApp", show_time=True)

log.info("Application started")
log.success("Connected to server")
log.warning("Rate limit approaching")
log.error("Connection failed")
log.money("Payment received [$50.00]")
log.debug("Internal state: ok")
log.captcha("Captcha detected on session_abc****")
log.custom("Special event", symbol="★", color=Colors.BRIGHT_YELLOW)

Output

07:23 AM [¥] Application started
07:23 AM [+] Connected to server
07:23 AM [!] Rate limit approaching
07:23 AM [-] Connection failed
07:23 AM [$] Payment received [$50.00]
07:23 AM [~] Internal state: ok
07:23 AM [¥] Captcha detected on session_abc****
07:23 AM [★] Special event

Title Bar

log.print_title_bar(
    "MyApp v1.0",
    "@rowsvips",
    "vmshops.mysellauth.com",
    stats={"Success": 10, "Failed": 2}
)
────────────────────────────────────────────────────────────────────────────────
 MyApp v1.0 | @rowsvips | vmshops.mysellauth.com | Success: 10 - Failed: 2
────────────────────────────────────────────────────────────────────────────────

Console Window Title

log.set_title("MyApp v1.0", "@rowsvips")
log.set_title_stats(Success=10, Failed=2, Captcha=5)

Counter System

log.increment("success")
log.increment("failed", 3)

print(log.get_count("success"))
print(log.get_all_counts())

log.reset_counts()

Contextual Helpers

log.redeemed("code_abc****", "session_123****", "[AT: 2.5s | Type: Premium]")
log.failed("Process Task", "Error: session expired")
log.added("Account", "user_xyz****", "session_123****")
log.removed("Session", "session_old****")
log.thread_sleep(5, "Before retry")

Custom Symbols & Colors

log.custom("Diamond", symbol="♦", color=Colors.BRIGHT_MAGENTA)
log.custom("Heart", symbol="♥", color=Colors.BRIGHT_RED)
log.custom("Arrow", symbol="→", color=Colors.BRIGHT_CYAN)

Inline Colored Text

token = Logger.colorize("session_abc****", Colors.BRIGHT_CYAN)
log.info(f"Processing on {token}")

log.info(f"Status: {Logger.bold('ACTIVE')}")

Utilities

log.separator()
log.separator(char="=", length=40, color=Colors.CYAN)

log.blank()
log.clear()

log.banner("All Done!", color=Colors.BRIGHT_GREEN, width=50)

Options

Parameter Default Description
title "Application" Application title
show_time True Show timestamps
time_format "%I:%M %p" Time format (12h AM/PM)
title_separator " | " Separator for title parts
title_color Colors.CYAN Title bar color
time_color Colors.BRIGHT_BLACK Timestamp color
bracket_style "square" Bracket style: square, round, angle, curly
log_file None Optional file path to save logs

Log File

log = Logger(log_file="app.log")
log.info("This goes to terminal AND file")

Log Levels

Method Symbol Color
info() [¥] Cyan
success() [+] Green
warning() [!] Yellow
error() [-] Red
money() [$] Bright Green
input_log() [>] Magenta
debug() [~] Gray
captcha() [¥] Yellow
custom() Custom Custom

Default Instance

from spanlogger import log

log.info("Quick access without creating an instance")

License

MIT - by rowsvips | vmshops.mysellauth.com

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

spanlogger-1.0.0.tar.gz (7.6 kB view details)

Uploaded Source

Built Distribution

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

spanlogger-1.0.0-py3-none-any.whl (7.0 kB view details)

Uploaded Python 3

File details

Details for the file spanlogger-1.0.0.tar.gz.

File metadata

  • Download URL: spanlogger-1.0.0.tar.gz
  • Upload date:
  • Size: 7.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.3

File hashes

Hashes for spanlogger-1.0.0.tar.gz
Algorithm Hash digest
SHA256 e193b7c2fd6357e0d3889033a7df008ad583baf3a3746f0ed5d84d15986d774a
MD5 0a3b78894c5bc6288c0ad75365ce7d14
BLAKE2b-256 2ea3e212ba94605c827b707e47519893c33a097ac0da10c7e499c5475be39b0f

See more details on using hashes here.

File details

Details for the file spanlogger-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: spanlogger-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 7.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.3

File hashes

Hashes for spanlogger-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 441f36e44ff84d407976298f318f36e526283d1bf2ee9e7a1ab3e4ac79682a51
MD5 da2dd80308271cefc0ba0d9bf5c205af
BLAKE2b-256 670a8e0ae34b461c736306fd2f2433ff16d9d706afa84166521ec1082da32970

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