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")
Metadata
Release files for simple-glogging 1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| simple-glogging-1.0.tar.gz | 2.9 kB | Without provenance | Details for simple-glogging-1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| simple_glogging-1.0-py3-none-any.whl | Python 3 | none | any | Details for simple_glogging-1.0-py3-none-any.whl |
Total release size: 6.1 kB
Release files / simple-glogging-1.0.tar.gz
| Download URL | simple-glogging-1.0.tar.gz |
|---|---|
| Size | 2.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
f16cbc687bd56d1c734d028a8fc545040c9790409426b6bdda9042b613396cdd
|
|
BLAKE2b-256 checksum How to use checksums |
f8e5d8c470c1e5819f20afed15eaac83061712de1a03f5b95a4c0d7b96bd0949
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.8.10
|
Release files / simple_glogging-1.0-py3-none-any.whl
| Download URL | simple_glogging-1.0-py3-none-any.whl |
|---|---|
| Size | 3.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
b6a8be59760de0db7bea9e49c301f75cf8583ddc7b9099416ea49eb0682db877
|
|
BLAKE2b-256 checksum How to use checksums |
a02721c981db2541d823f9f90c12ebb44bdde8dcc942b4e57dbfaa40e0e9e68e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.8.10
|
Security for simple-glogging 1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.