https://github.com/tomosfps/aerialog
Simple Python Logger, built for personal projects.
https://github.com/tomosfps/aerialog
colourful logger logging python3
Last synced: about 2 months ago
JSON representation
Simple Python Logger, built for personal projects.
- Host: GitHub
- URL: https://github.com/tomosfps/aerialog
- Owner: tomosfps
- License: mit
- Created: 2024-10-20T21:07:52.000Z (7 months ago)
- Default Branch: main
- Last Pushed: 2024-10-20T21:44:39.000Z (7 months ago)
- Last Synced: 2025-03-23T09:48:37.077Z (2 months ago)
- Topics: colourful, logger, logging, python3
- Language: Python
- Homepage:
- Size: 3.79 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Aerialog
A simple, yet effective logger built in Python.
## Features
- [x] Easily log to terminal or file
- [x] Coloured coded (only within terminal)
- [x] Log to file later on, and remove it
- [x] Lightweight, only needing one extra dependency
- [x] Load Log Level through .env or set it through the class## Using Aerialog
1. Run `python3 -m venv env` and then activate the environment through `source env/bin/activate` (may differ on Windows)
2. Install the dependency using your preferred method `pip install aerialog`
3. Import the dependency into your code `import aerialog.logger import Logger`
4. Initalise the class and freely use it `log = Logger()`You may also use `.env` files and directly set the log_level through that too
```env
#FATAL, ERROR, WARN, INFO, DEBUG, SILLY
# If not any of those above, it will default to DEBUG
# If it's not called LOG_LEVEL it will also default to DEBUG
LOG_LEVEL=DEBUG
```## Example
```python
from aerialog import Logger
log = Logger()
def main():
log.info("This is a really interesting info message!", "Main")
log.error("Oh no! an error happened here", "Error")def file_setup():
log.set_file("awesome-project.log")
log.info("This now gets logged to the file!", "File")
log.remove_file() # It will now log back to the terminal
```## Licence
This project uses the following license: [PYTHON PACKAGING AUTHORITY](https://github.com/devtomos/aerialog/blob/main/LICENSE.md).