Skip to content

rosebudsystems/ScribeLog

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PyPI version

ScribeLog Logo

Readme in EnglishReadme 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 .log file.
  • 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.

About

A lightweight Python library for logging messages to text files.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Contributors

Languages