• Readme in English • Readme 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.
- Log messages to a specified
.logfile. - Validate the file path and extension.
- Add timestamps to log entries.
- Simple configuration and usage.
To install ScribeLog, run:
pip install ScribeLogfrom 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())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}")ScribeLog is licensed under the MIT License. See the LICENSE file for details.
