Skip to main content

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

Release files for MT-PY-ErrorLogging 0.0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for MT-PY-ErrorLogging 0.0.1
File Size Uploaded
MT_PY_ErrorLogging-0.0.1.tar.gz 2.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for MT-PY-ErrorLogging 0.0.1
File Interpreter ABI Platform
MT_PY_ErrorLogging-0.0.1-py3-none-any.whl Python 3 none any Details

Total release size: 6.7 kB

Release files / MT_PY_ErrorLogging-0.0.1.tar.gz

Download URL MT_PY_ErrorLogging-0.0.1.tar.gz
Size 2.9 kB
Tags Source
SHA-256 checksum
How to use checksums
78e2628f6ba8817ac764012f0517c9e02462bf47cec785a99f8bbf3188d4fc95
BLAKE2b-256 checksum
How to use checksums
5602c1cb8073eea8a781b5037872624544c1c202ece2e3bad621f4f86d514fd1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.10.11

Release files / MT_PY_ErrorLogging-0.0.1-py3-none-any.whl

Download URL MT_PY_ErrorLogging-0.0.1-py3-none-any.whl
Size 3.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
347854c9139bd67802307c08571c23fe17bb67770f4c96734fe007b3fec49add
BLAKE2b-256 checksum
How to use checksums
aa1d0dfa07734b54034f70349534dc076f9052203cfd20232ca1666653e69d87
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.10.11

Release history Release notifications | RSS feed

This release

0.0.1 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page