A Mouritech package
Project description
sample package on Logging Error
Project Title
Mouritech
package name : Mouritech_LoggingErrorMT_PY_ErrorLogging
Creating custom package for Logging Errorin python. This is the project ,Whenever you need to check the level of Errors in a code .
Technologie
Python
Installation
Install my-project with Python Install MT_PY_ErrorLogging
pip install MT_PY_ErrorLogging
cd MT_PY_ErrorLogging
(globally) pip install MT_PY_ErrorLogging
Steps
pip install MT_PY_ErrorLogging
(or)
pip install MT_PY_ErrorLogging
from MT_PY_ErrorLogging.MT_Errorlogging import MT_Logger from MT_ErrorLogging import MT_Logger
MT_Logger(
)
Authors
Used By
This project is used by the following Cases:
- Projects :-Logging Error is one of the debugging tool which is used to track the log levels of the cod e(error levels of the code )
Receiver Example :
pip install MT_PY_ErrorLogging
from MT_PY_ErrorLogging.MT_Errorlogging import MT_Logger from MT_Errorlogging import MT_PY_ErrorLogging
MT_PY_ErrorLogging(
)
this is the file here we are doing some testcase purpose
import logging #we are importing our package here from MT_PY_ErrorLogging.MT_Errorlogging import MT_Logger
Create a logger
logger = logging.getLogger("fileerrors:") logger.setLevel(logging.ERROR)
Define a custom error handler
class MT_LoggerHandler(logging.Handler): # creating a class def emit(self, record): # creating a function if isinstance(record.exc_info[1], LoggerDemoConsole): print(f"Custom Error: {record.msg}")
Add the custom error handler to the logger
logger.addHandler(MT_LoggerHandler())
Output:
06/01/2023 05:31:15PM - LoggerDemoConsoleINFO: info message 06/01/2023 05:31:15PM - LoggerDemoConsoleWARNING: warn message 06/01/2023 05:31:15PM - LoggerDemoConsoleERROR: error message 06/01/2023 05:31:15PM - LoggerDemoConsoleCRITICAL: critical message
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
File details
Details for the file MT_PY_ErrorLogging-0.0.1.tar.gz
.
File metadata
- Download URL: MT_PY_ErrorLogging-0.0.1.tar.gz
- Upload date:
- Size: 2.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.11
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 78e2628f6ba8817ac764012f0517c9e02462bf47cec785a99f8bbf3188d4fc95 |
|
MD5 | 046fc7740199898e4e53d96855a344b1 |
|
BLAKE2b-256 | 5602c1cb8073eea8a781b5037872624544c1c202ece2e3bad621f4f86d514fd1 |
File details
Details for the file MT_PY_ErrorLogging-0.0.1-py3-none-any.whl
.
File metadata
- Download URL: MT_PY_ErrorLogging-0.0.1-py3-none-any.whl
- Upload date:
- Size: 3.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.11
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 347854c9139bd67802307c08571c23fe17bb67770f4c96734fe007b3fec49add |
|
MD5 | 6d3ebabcf9d76017ae89d07a740b01f4 |
|
BLAKE2b-256 | aa1d0dfa07734b54034f70349534dc076f9052203cfd20232ca1666653e69d87 |