A lightweight logging utility with terminal color support and file output capabilities.
Project description
Too Simple Logging
A lightweight logging utility with terminal color support and file output capabilities.
Features
- Simple and Easy to Use: Focuses on providing basic logging functionality without complex configurations.
- Colorful Terminal Output: Utilizes the rich library for colorful logging in the terminal.
- File Output: Supports writing logs to a file for later review.
- Dynamic Log Levels: Allows adjusting the log level at runtime.
Installation
You can install Too Simple Logging using pip:
pip install toosimplelogging
Usage
import toosimplelogging as tsl
# Set log level
tsl.set_log_level("DEBUG")
# Enable file output
tsl.fileout(True, "logfile.log")
# Log messages
tsl.info("This is an info message.")
tsl.warning("This is a warning message.")
tsl.error("This is an error message.")
tsl.debug("This is a debug message.")
tsl.critical("This is a critical message.")
#Get help
tsl.help()
API Documentation
Functions
set_log_level(level: str): Sets the logging level. Valid levels are DEBUG, INFO, WARNING, ERROR, CRITICAL.
fileout(enable: bool, filename: str = None): Enables or disables file output. If enabled, a filename must be provided.
info(message: str): Logs an informational message.
warning(message: str): Logs a warning message.
error(message: str): Logs an error message.
debug(message: str): Logs a debug message.
critical(message: str): Logs a critical message.
License
This project is licensed under the MIT License. See the LICENSE file for details.
Contact
For any questions or support, feel free to reach out via email at admin@yang325.eu.org.
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 toosimplelogging-0.1.0.tar.gz.
File metadata
- Download URL: toosimplelogging-0.1.0.tar.gz
- Upload date:
- Size: 4.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6b783238d8ff085dc5e9411af2c97a2241f6e497f6cdc0d65b6f381bb1c87997
|
|
| MD5 |
75d25aec3b15956e53c3545f39075181
|
|
| BLAKE2b-256 |
852a25802f20d4d994409c53e801beb573b01bb1b3914bf9bd96eed2b2f7e9c1
|
File details
Details for the file toosimplelogging-0.1.0-py3-none-any.whl.
File metadata
- Download URL: toosimplelogging-0.1.0-py3-none-any.whl
- Upload date:
- Size: 4.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
51189ce4abcd1edb108c4870500a5274aa257dfa22f4c5ce5ef8ad8fb515eb93
|
|
| MD5 |
da1ffdc1853f1d6ab10ba425da9e9c3b
|
|
| BLAKE2b-256 |
41319024de93a1958decca8e1bec66d745c9d097afe6b2ccc8ec76a62176e0fd
|