a logger for applications, not libs
Project description
applog
A beautiful, zero-dependency logging formatter for Python with colors, clickable file links, and intelligent number highlighting.
Features
- 🎨 Colored output by log level (respects
NO_COLORandFORCE_COLORstandards) - 🔗 Clickable file links (OSC 8 hyperlinks) - Ctrl+Click to open in your editor
- 🔢 Automatic number highlighting - numbers stand out in your logs
- 📦 Zero external dependencies - pure Python standard library
- 🚀 No pre-rendering - logs wrap correctly when terminal resizes
- ⚙️ Environment variable aware - follows
NO_COLOR,FORCE_COLORconventions
Installation
uv add applog
Quick Start
from applog import logger
logger.debug("Debug message")
logger.info("Info message")
logger.warning("Warning message")
logger.error("Error message")
logger.critical("Critical message")
Output (imagine this with colors, since github does not allow colors):
Thu 12:42:25 | DEBUG | <module>: Debug message
Thu 12:42:26 | INFO | <module>: Info message
Thu 12:42:26 | WARNING | <module>: Warning message
Thu 12:42:26 | ERROR | <module>: Error message
Thu 12:42:26 | CRITICAL | <module>: Critical message
Changing Date Format
from applog import root_logger
# Change to 24-hour time without seconds
root_logger.handlers[0].formatter.datefmt = '%H:%M'
# Change to full datetime
root_logger.handlers[0].formatter.datefmt = '%Y-%m-%d %H:%M:%S'
Customizing Colors
from applog import Color, root_logger
# Modify color codes (ANSI escape sequences)
Color.INFO = '\033[94m' # Bright blue for INFO
Using with Standard Logging
applog configures the root logger, so any standard logging calls will use the same formatting:
import logging
from applog import logger
# These will all have the same beautiful formatting
logging.warning("Root logger warning")
custom_logger = logging.getLogger(__name__)
custom_logger.info("Custom logger info")
Advanced Usage
Adding Handlers
from applog import root_logger
import logging
# Add file handler
file_handler = logging.FileHandler('app.log')
file_handler.setFormatter(logging.Formatter('%(asctime)s - %(levelname)s - %(message)s'))
root_logger.addHandler(file_handler)
Creating Child Loggers
from applog import logger
module_logger = logger.getChild('module_name')
module_logger.info("This will inherit parent settings")
Notes
- The module configures the root logger on import - import it early in your application.
- Hyperlinks use OSC 8 sequences - won't work in very old terminals
Why applog?
- vs rich.logging: Logs adapt when you resize your terminal (no pre-rendering)
- vs loguru: Works with all standard
loggingcalls out of the box - The result: Beautiful, clickable, dependency-free logging that just works
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file applog-1.0.0.tar.gz.
File metadata
- Download URL: applog-1.0.0.tar.gz
- Upload date:
- Size: 3.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.11.14 {"installer":{"name":"uv","version":"0.11.14","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
08104ff2a9e30a5921c2b5233d52c6ae12d2c11baac5f1dab89452e341a7b793
|
|
| MD5 |
0f7e2dd3ecdd85ed8c6038643de239c8
|
|
| BLAKE2b-256 |
cb6eb2a767668aef684eb8f2e6503bdbba48a9f5df98cb4caf67f682852a0189
|
File details
Details for the file applog-1.0.0-py3-none-any.whl.
File metadata
- Download URL: applog-1.0.0-py3-none-any.whl
- Upload date:
- Size: 3.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.11.14 {"installer":{"name":"uv","version":"0.11.14","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f4a5f3b027670a4b2a7ab30478f6a2e7cd83c061a7238b559e7790a54b0e5ab3
|
|
| MD5 |
504aa2760f0245e116f96c748ac373db
|
|
| BLAKE2b-256 |
c6c36e13d6fb026f388dc1e0750301e3262679dbc8bed1c7a7df5e5e048e2d0e
|