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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Close
Hashes for py_pkg_logging-0.0.3rc0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 63e373034e0a5292da373119f75cb91efeed0a375187f16c8aadef8f8592aae5 |
|
MD5 | ec6d14d9549c5d64ce8d06b9b42b55fc |
|
BLAKE2b-256 | 926650b152ce128ab2068b0c319b5188901c8f092d21674b7c83c9900cf5e4a7 |