Simplified log tool that allows an easy manageable global logger
Project description
Log-Shot
A simplified log tool with some custom features that allows to manage loggers across multiple python files, with a root logger that is easy to enable or disable whenever it is necessary from any file.
Installation
pip install logshot
Usage Example
# -- Global logger config
title = "log-file"
logs_dir = 'logs'
if not os.path.exists(logs_dir):
os.mkdir(logs_dir)
logging.config_log_capture(logs_dir, logfile_title=title)
logging.root_level = logging.DEBUG;
logging.start_log_capture()
# -- Logger
logger = logging.Logger(module_name=__name__)
logger.level = logging.DEBUG
...
logger.info("Opening example path...")
try:
with open('C:\\Users\\example\\of\\logshot\\package', 'r') as file:
...
except Exception as err:
logger.error(err); exit(1)
File Output
2022-01-24 00:59:32.138305
[INFO] __main__: Opening example path...
2022-01-24 00:59:40.446509
[ERROR] __main__: [WinError 3] The system cannot find the path specified: 'C:\\Users\\example\\of\\logshot\\package'
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
No source distribution files available for this release.See tutorial on generating distribution archives.
Built Distribution
File details
Details for the file logshot-0.0.5-py3-none-any.whl
.
File metadata
- Download URL: logshot-0.0.5-py3-none-any.whl
- Upload date:
- Size: 4.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.7.1 importlib_metadata/4.10.1 pkginfo/1.8.2 requests/2.27.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7bf4ff33e9eee16222e3b64c21d6a1645b362a64bdf623637521ac99851ea762 |
|
MD5 | 1e8d8e013afd6eea4e14c518dbbf330b |
|
BLAKE2b-256 | 2f566d80a59c90d048f582096ad55ead2b74a806513e8ab9f77e2a3bd295239d |