eLog
is a Python library designed to help you log errors to a Notion database, where they can be sorted by file and any other provided data point. It takes an error and the filename as input, then uses the Notion API to either update an existing page in the database or create a new one, depending on whether a page with a matching error and filename already exists.
This allows you to stay on top of each and every error, between all of your applications and projects.
- Searches for existing pages in a Notion database with the same error and filename.
- If a match is found, updates the 'Count' property, records the current time in the 'Last Seen' field, sets the 'Status' property to 'Not Resolved', and overwrites the body with the latest error.
- If no match is found, creates a new page in the database with the provided error and filename, and adds the error details in the body.
- Returns a status code indicating the success or failure of the operation.
- Can be imported as a library or executed as a standalone Python script, making it versatile and compatible with multiple languages.
- Python 3.7+
- Notion API Key
- Duplicated Error Log Notion Page
Clone the repository:
git clone https://github.com/xozxro/eLog.git
cd eLog
Install the package:
pip install .
Configure your Notion API Key and error page:
py configure.py
Execute the created script as admin to set env variables:
sudo ./set_env.sh
Or, from an elevated Windows terminal:
set_env.bat
Done!
Run the script from the command line (or any other language):
elog filename.py "This is your error message"
Import and use the library in your Python script:
from eLog import eLog
e = eLog('test.py')
e.log('Succesfully pushed an error!')
We welcome contributions! Please feel free to submit a PR.
This project is licensed under the terms of the MIT license.