Skip to main content

A Python logging helper

Project description

sharklog

Python logging helper.

PyPI License PyPI Version PyPI Downloads

Quick Start

  • Install sharklog:
python -m pip install sharklog
  • Use in standalone script:
# standalone.py
from sharklog import logging

logging.init(debug=True)
logging.debug("debug message")
logging.info("info message")
logging.warning("warning message")
logging.error("error message")
  • Use in module:
# submodule.py which is placed under package `parent`
from sharklog import logging

logger = logging.getLogger()    # the logger name will be `parent.submodule`

logger.debug("debug message")
logger.info("info message")
logger.warning("warning message")
logger.error("error message")

If you already using builtin logging module, you can use sharklog as a drop-in replacement.

Just change import logging into from sharklog import logging. Then you can use logging as usual:

# module_name.py
from sharklog import logging

# these log messages will be prefixed with the logger name `xxxpackage.xxmodule.module_name`
logging.debug("debug message")
logging.info("info message")
logging.warning("warning message")
logging.error("error message")

Usage in Package Development

# parent/__init__.py
from sharklog import logging

logging.getLogger().addHandler(logging.NullHandler())

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

sharklog-0.0.3.tar.gz (3.9 kB view details)

Uploaded Source

Built Distribution

sharklog-0.0.3-py3-none-any.whl (5.1 kB view details)

Uploaded Python 3

File details

Details for the file sharklog-0.0.3.tar.gz.

File metadata

  • Download URL: sharklog-0.0.3.tar.gz
  • Upload date:
  • Size: 3.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.0 CPython/3.8.10

File hashes

Hashes for sharklog-0.0.3.tar.gz
Algorithm Hash digest
SHA256 d51729be408318387086fdd7ce204fc446b207a46906da7aca6f640e980e97c9
MD5 9c16d109d5a8fb0b7d7bce89f6117610
BLAKE2b-256 38eeae7e9cfd6a97fca0bac4af29c288258ecced5fe5f16925ff93ac3847bab5

See more details on using hashes here.

File details

Details for the file sharklog-0.0.3-py3-none-any.whl.

File metadata

  • Download URL: sharklog-0.0.3-py3-none-any.whl
  • Upload date:
  • Size: 5.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.0 CPython/3.8.10

File hashes

Hashes for sharklog-0.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 ebc384b9c1c636115192e00e24489523cb67c7c76549b1e3fed67048e4ed6a97
MD5 04bff863c06b2da3d989fcc7c9351812
BLAKE2b-256 015d8437b9c9b48578ad00aa0aadb6ac88619bd4bdfe90fb3da0becaf4735b48

See more details on using hashes here.

Supported by

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