Skip to main content

LupinDental logger

Project description

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 .lupinlog.jsonl files
  • 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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

lupin_logger-0.2.0.tar.gz (6.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

lupin_logger-0.2.0-py3-none-any.whl (6.8 kB view details)

Uploaded Python 3

File details

Details for the file lupin_logger-0.2.0.tar.gz.

File metadata

  • Download URL: lupin_logger-0.2.0.tar.gz
  • Upload date:
  • Size: 6.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.14

File hashes

Hashes for lupin_logger-0.2.0.tar.gz
Algorithm Hash digest
SHA256 43ce95800e6dd0a52ee4f27c199a0cfb65329abdfe1b6d9c2699c8e3cca79f9c
MD5 3a66ff4c184be2f490f2f8bb2d9494ea
BLAKE2b-256 1c3777a38e7d63ed1a113c92671195b133fc6beb2432a8e24a8fe1cf2c9437bf

See more details on using hashes here.

File details

Details for the file lupin_logger-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: lupin_logger-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 6.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.14

File hashes

Hashes for lupin_logger-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 82dde600ca627796a10f1c68165b8cf15cf5582d01304d644ba60df34a42e749
MD5 1fbb8b3459ccd104ee5bc17b2aa79b67
BLAKE2b-256 5614337c9294ddf86f3c3ad0d7c7f62aacaa33ba84681065ae692a5744e2f900

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page