Lupin Logger
A custom logging system for LupinDental with colored console output and structured JSON logging.
Features
- Colored console output with visual formatting based on log level
- Structured JSON logs saved to
.lupinlogs.jsonlfiles - Custom attributes with automatic type-based coloring
- Custom NOTICE level (between INFO and WARNING)
- Automatic organization of logs by date
- Full traceability with timestamp, application, origin, and location
Installation from PYPI
pip install lupin_logger
Deployment on PYPI
- Add the version to pyproject.toml
version = "0.1.0"
-
Go to GitLab Tags
- Click on New tag
- Select the main branch if it is a final tag and click on Create tag.
- Select the current branch if it is a test or development tag.
Quick Start
from lupin_logger import get_logger
# Create a logger
logger = get_logger(name="my_module", app="my_application")
# Basic logs
logger.info("Application started")
logger.debug("Debug information")
logger.warning("Warning!")
logger.error("An error occurred")
logger.critical("Critical error")
# Custom NOTICE level
logger.notice("Important operation succeeded")
Logging with Attributes
Attributes allow you to add structured data to your logs:
# Simple attributes
logger.info("File processed", {"filename": "data.csv", "rows": 1500})
# With different types (automatic coloring)
logger.info("Process completed", {
"duration": 3.14, # float → yellow
"success": True, # bool → white
"files_count": 42, # int → yellow
"output_path": Path("/tmp/out") # Path → cyan
})
# Exception logging
try:
result = 1 / 0
except Exception:
logger.exception("Division by zero", {"operation": "calculate"})
Log Levels
| Level | Usage | Console Color |
|---|---|---|
| DEBUG | Detailed debugging information | Blue |
| INFO | General information | White |
| NOTICE | Important successful events | Green |
| WARNING | Warnings | Yellow |
| ERROR | Non-critical errors | Red |
| CRITICAL | Critical errors requiring attention | Magenta |
Log Directory Configuration
By default, logs are saved to:
- Linux/macOS:
~/LupinDentalData/logs/ - Windows:
C:/Users/<USERNAME>/LupinDentalData/logs/
Custom Directory
logger = get_logger(
name="my_module",
app="my_app",
log_directory="/custom/path/logs"
)
Development
Requirements
- Python >= 3.11
Development Installation
git clone https://gitlab.com/lupindental/arsene/rd-utilities/lupin_logger.git
cd lupin_logger
pip install -e .
License
MIT - LupinDental
Metadata
Release files for lupin-logger 0.5.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| lupin_logger-0.5.1.tar.gz | 10.4 kB | Without provenance | Details for lupin_logger-0.5.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| lupin_logger-0.5.1-py3-none-any.whl | Python 3 | none | any | Details for lupin_logger-0.5.1-py3-none-any.whl |
Total release size: 18.8 kB
Release files / lupin_logger-0.5.1.tar.gz
| Download URL | lupin_logger-0.5.1.tar.gz |
|---|---|
| Size | 10.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
ab2f66ef390f1426da1f35b51e2750b87debb7ca6bc8582ceecf76d22f3146e5
|
|
BLAKE2b-256 checksum How to use checksums |
ec004fca7f833e8083838d97e4326d7502511f813cea98a4e10d2c812f9a670f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.11.15
|
Release files / lupin_logger-0.5.1-py3-none-any.whl
| Download URL | lupin_logger-0.5.1-py3-none-any.whl |
|---|---|
| Size | 8.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
d0e05f3ab02f0bc1953926cce7d24a67c0df52889a6654967794d43332d8d94b
|
|
BLAKE2b-256 checksum How to use checksums |
20761bd0ec13ac0a008e6678a12835a50d1485e8d7c8868b95061341a73efc57
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.11.15
|
Security for lupin-logger 0.5.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.