Log Symbols
Log Symbols provides colored symbols (like ✓, ✖, ℹ, ⚠) for various log levels in Python, enhancing terminal output readability. The current version is 0.0.14, with the last release in August 2019, indicating a stable but not actively developed library. It includes fallbacks for Windows CMD, which has a limited character set.
Warnings
- gotcha The `log-symbols` library is not directly integrated with Python's standard `logging` module. You need to explicitly print the symbols alongside your log messages if you want to use `logging` functionality (e.g., `logger.info(LogSymbols.info + ' Message')`). It merely provides the symbols as strings.
- gotcha The library's last release was in August 2019, meaning it's not actively maintained. While it's stable for its intended purpose, there will be no new features or updates for compatibility with very recent Python versions or terminal advancements.
- gotcha Direct concatenation of symbols with non-string types can lead to `TypeError`. Ensure that any message combined with a log symbol is first converted to a string.
Install
-
pip install log-symbols
Imports
- Log Symbols
from log_symbols import LogSymbols
- Direct Symbols (e.g., success)
from log_symbols import success, info, warning, error
Quickstart
from log_symbols import LogSymbols print(LogSymbols.success + ' Finished successfully!') print(LogSymbols.info + ' This is an informational message.') print(LogSymbols.warning + ' A potential issue occurred.') print(LogSymbols.error + ' Something went wrong!') # Or directly import symbols from log_symbols import success, info, warning, error print(success + ' Direct import example.')