A library to use logging Package
Project description
Simple Logging
simple-logging is a Python package that contains methods for interacting with logging package.
Installation and updating
Use the package manager pip to install simplelogging like below. Rerun this command to check for and install updates .
pip install simplelogging
Usage
On the host or client code please add a directory at the root level, name it resources. Create a ymal file for log configuration below are the simple configuration template
handelers:
file:
filepath: 'logs/appLog_{:%Y-%m-%d}.json'
formate: '%(asctime)s %(levelname)s %(name)s %(module)s %(funcName)s %(filename)s %(lineno)s %(message)s'
loglevel: DEBUG
console:
formate: '%(asctime)s %(levelname)s %(name)s %(module)s %(funcName)s %(filename)s %(lineno)s %(message)s'
loglevel: DEBUG
default_loglevel: ERROR
default_formate: '%(asctime)s %(levelname)s %(name)s %(module)s %(funcName)s %(filename)s %(lineno)s %(message)s'
How to create distribution
- Delete existing dist folder on project root directory
- Execute below command on project root directory ** python3 setup.py sdist
How to upload distribution to pypi python3 -m twine upload --repository pypi dist/*
Usage:
root_log_name = 'ROOT_LOGGER' sl = SimpleLogging(root_log_name) sl.logger.info("This is from root logging") sl.getLogger("Child logger").info("This is child logger") sl.initializeLogger() print("==================After Initializing =========================") log = sl.getLogger("Child1") log.info("This is info in child 1 logger") log.error("This is error in child 1 logger")
print("=================== After Updating ============================") change_settings = {'level':'DEBUG'} sl.updateLogger(**change_settings)
log = sl.getLogger("Child2") log.info("This is info in child 2 logger") log.debug("This is debug in child 2 logger") log.error("This is error in child 2 logger")
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
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file simple-glogging-1.0.tar.gz.
File metadata
- Download URL: simple-glogging-1.0.tar.gz
- Upload date:
- Size: 2.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.8.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f16cbc687bd56d1c734d028a8fc545040c9790409426b6bdda9042b613396cdd
|
|
| MD5 |
9fe1e5e670cd6ca363cf7029b3a2eeb4
|
|
| BLAKE2b-256 |
f8e5d8c470c1e5819f20afed15eaac83061712de1a03f5b95a4c0d7b96bd0949
|
File details
Details for the file simple_glogging-1.0-py3-none-any.whl.
File metadata
- Download URL: simple_glogging-1.0-py3-none-any.whl
- Upload date:
- Size: 3.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.8.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b6a8be59760de0db7bea9e49c301f75cf8583ddc7b9099416ea49eb0682db877
|
|
| MD5 |
38d3a8d5f1851d45d6278dfb14375c2c
|
|
| BLAKE2b-256 |
a02721c981db2541d823f9f90c12ebb44bdde8dcc942b4e57dbfaa40e0e9e68e
|