Skip to main content

Custom logging package for MEH projects.

Project description

meh-logging-python

Python


Before you start

To use the logging module in Python, you will need to have a Manifest file called package.json in the project's root folder. The file should follow the file structure guidelines provided at https://docs.npmjs.com/cli/v9/configuring-npm/package-json.

Prerequisite software

The software listed below is required beforehand.

Enum Value
python >= 3.10
pip >= 22.2

Installation

To install the module from your terminal, simply execute the following command:

$ pip install meh_logging

Usage

The logging module searches for an OS environment variable called PYTHON_ENV or ENV. If the variable is set to "production", the module will use the log level INFO; otherwise, it will use DEBUG.

from meh_logging import logger, Levels

# Log some info
logger.info("hello world")
logger.debug("hello world")
logger.error("hello world")

# Log exception
try:
    1 / 0
except Exception as e:
    logger.info(e)

# Change log-level dynamically
logger.set_level(Levels().CRITICAL.value)

Levels

These are the log levels utilized by the module.

Enum Value
NOT_SET 0
DEBUG 10
INFO 20
WARNING / WARN 30
ERROR 40
CRITICAL 50

Author(s)

Jim de Ronde

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

meh_logging-1.0.4.tar.gz (5.9 kB view details)

Uploaded Source

Built Distribution

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

meh_logging-1.0.4-py3-none-any.whl (6.9 kB view details)

Uploaded Python 3

File details

Details for the file meh_logging-1.0.4.tar.gz.

File metadata

  • Download URL: meh_logging-1.0.4.tar.gz
  • Upload date:
  • Size: 5.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.12

File hashes

Hashes for meh_logging-1.0.4.tar.gz
Algorithm Hash digest
SHA256 93b44c99c361496244ca3d948fbd44de6898fa0b60bb890f48d4299a521d9ab8
MD5 535891c029b0c43eabe92a97ab679924
BLAKE2b-256 2e179b47ca48d06526796848060977b23bd303e3c832f5161fdf24a90b928a37

See more details on using hashes here.

File details

Details for the file meh_logging-1.0.4-py3-none-any.whl.

File metadata

  • Download URL: meh_logging-1.0.4-py3-none-any.whl
  • Upload date:
  • Size: 6.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.12

File hashes

Hashes for meh_logging-1.0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 b6032ff03ee0295a362ca52828c8352f2cb044a119ee72f5232ca9beb27ee7c7
MD5 e359a15fd1516c4b78bb378ac65e2fde
BLAKE2b-256 2f9e94768261cda8452e8a2a016edf2ec5e10fa92dd55c6a9074f1a5f95bcc17

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