Skip to main content

Python Package Logging Assistant.

Project description

py-package-logging

Install

pip install py-pkg-logging

Use

Package-level logging

Set up package-level logging in pkg/__init__.py

# -- set up logging: ----------------------------------------------------------
import logging as _logging
import py_pkg_logging as _ppl

_log_config = _ppl.LogConfig(name = "pkg", log_file="pkg.log")

_logger = _logging.getLogger(f'pkg.{__name__}')

_logger.info(f"Logs for sdk will be saved to: {_log_config.log_fpath}")
_logger.debug(f"Importing from local install location: {__file__}")

# the rest of your package-level import statements

Example use of in-line function-call logging:

# -- set up logger: -----------------------------------------------------------
import py_pkg_logging
import logging

logger = logging.getLogger(__name__)


@py_pkg_logging.log_function_call(logger)
def persistent_executer(a, b, c):
    return (a + b) * c

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

py_pkg_logging-0.0.3.tar.gz (3.5 kB view details)

Uploaded Source

Built Distribution

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

py_pkg_logging-0.0.3-py3-none-any.whl (4.7 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for py_pkg_logging-0.0.3.tar.gz
Algorithm Hash digest
SHA256 5dd14ef65369acce4e4c161a02a1d31c4b7bb2726c177681c09be75dc5641c04
MD5 139c3a42f7f10d17a01fbf82f067393b
BLAKE2b-256 ae6638da466a472181bb21ec24f057f8c8e3bb7eb90e8aa93ecac337ecbb1007

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for py_pkg_logging-0.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 36275248416c0f7af86493475946e1aedb9333014c3796f80d49aeba969f9ae8
MD5 3f92db72a2a0cd26d0fcb171697d519b
BLAKE2b-256 9d449ce9505dcd224b2e6029029ff6f54db8f69f8ca83e33c68b065665350d0a

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