Skip to main content

Base utilities for the tvi.solphit namespace (logging, config, helpers).

Project description

tvi-solphit-base

Base utilities for the tvi.solphit namespace. This first release provides an environment-driven logging utility that defaults to stdout and can route to a file when configured.

  • Distribution name (PyPI): tvi-solphit-base
  • Import path: tvi.solphit.base
  • Namespace packaging: PEP 420 implicit namespace (no __init__.py in tvi/ or tvi/solphit/)

Author: Tobias Hagenbeek (SolphIT LLC)


Features

  • Minimal, reusable logger (SolphitLogger) with:
    • Standard levels: DEBUG|INFO|WARNING|ERROR|CRITICAL
    • Controlled by environment variables
    • Defaults to stdout; file output when configured
    • Idempotent setup (avoids duplicate handlers on repeat calls)

Installation

pip install tvi-solphit-base

Requires Python >=3.9.

Quickstart

from tvi.solphit.base import SolphitLogger

log = SolphitLogger.get_logger("tvi.solphit.example")
log.info("Hello, SolphIT!")

Configure the Environment

# Defaults:
# TVI_SOLPHIT_LOG_LEVEL=INFO
# TVI_SOLPHIT_LOG_DEST=stdout
# TVI_SOLPHIT_LOG_FILE=solphit.log
# TVI_SOLPHIT_LOG_FORMAT="%(asctime)s | %(levelname)s | %(name)s | %(message)s"

export TVI_SOLPHIT_LOG_LEVEL=DEBUG
export TVI_SOLPHIT_LOG_DEST=file
export TVI_SOLPHIT_LOG_FILE=/var/log/solphit/base.log
python your_script.py

Override via code

log = SolphitLogger.get_logger(
    "tvi.solphit.example",
    level="WARNING",
    dest="file",
    file_path="local.log",
    fmt="%(levelname)s | %(message)s"
)

Versioning

This project uses Semantic Versioning. See the CHANGELOG.

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

tvi_solphit_base-0.1.0.tar.gz (4.3 kB view details)

Uploaded Source

Built Distribution

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

tvi_solphit_base-0.1.0-py3-none-any.whl (4.3 kB view details)

Uploaded Python 3

File details

Details for the file tvi_solphit_base-0.1.0.tar.gz.

File metadata

  • Download URL: tvi_solphit_base-0.1.0.tar.gz
  • Upload date:
  • Size: 4.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for tvi_solphit_base-0.1.0.tar.gz
Algorithm Hash digest
SHA256 aaa1902aed2216ef7c52d4c6f4d45bc1f41e77de6e37a6541850741641a04f16
MD5 5e871633c96e6708b54345ebda002477
BLAKE2b-256 810a9f02be8f3af1e2283b8f8b9bf746a722c22ddd14be51b7378e4ae3381a97

See more details on using hashes here.

File details

Details for the file tvi_solphit_base-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for tvi_solphit_base-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 78e72863853dd982fca3133c57df5cda0e26018b342009c24731c41f6c1ee431
MD5 e3d96ce46dad2deadce1137a6ea30971
BLAKE2b-256 bbfbb79f1525699c568ac5a59a978419d2e232a405cd6d710f452cc85b1ec3c1

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