A lightweight Python library for logging messages to text files.
Project description
ScribeLog
Read this in English | Leer esto en español
ScribeLog is a lightweight Python library for logging messages to text files. It offers path validation and optional timestamp support for your log entries.
Features
- Log messages to a specified
.logfile. - Validate the file path and extension.
- Add timestamps to log entries.
- Simple configuration and usage.
Installation
To install ScribeLog, run:
pip install ScribeLog
Usage
from ScribeLog import ConfigLog, Log, GetPathLogin
# Configure the log file
ConfigLog("/path/to/yourfile.log")
# Log a message with timestamp
Log("This is a test message.")
# Log a message without timestamp
Log("Another test message.", time=False)
# Retrieve the current log file path
print(GetPathLogin())
Error Handling
If the log file path is invalid or doesn't meet the requirements, a FileError will be raised. For example:
from ScribeLog import ConfigLog, FileError
try:
ConfigLog("/invalid/path/to/file.txt")
except FileError as e:
print(f"An error occurred: {e}")
License
ScribeLog is licensed under the MIT License. See the LICENSE file for details.
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 scribelog-0.1.0.tar.gz.
File metadata
- Download URL: scribelog-0.1.0.tar.gz
- Upload date:
- Size: 3.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.10.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6012007f59a4fe4b02540030260f9d3e715a7ea8ed7d5fadd29e43254f37ec77
|
|
| MD5 |
e7cc0e1917ed1e350ada6a901636f122
|
|
| BLAKE2b-256 |
f75d17fa4609a6a13d2d777e954a27a2d7fdd1b23f31c7b669225c011ea66ca0
|
File details
Details for the file ScribeLog-0.1.0-py3-none-any.whl.
File metadata
- Download URL: ScribeLog-0.1.0-py3-none-any.whl
- Upload date:
- Size: 4.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.10.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2570268174e9aefe50bcc27aa0959cb20322eca7a482d24b95396b4ba176849f
|
|
| MD5 |
ac3172500408c94f236b2fcdffced818
|
|
| BLAKE2b-256 |
09a4ce76fe2b5ed10bdfc682b1e32be444a2ca542bb1c0366a94180a33739433
|