Skip to main content

A simple(r) logger for Python

Project description

logEZ

Make logging easy in your applications! Use this simple library to easily use logs in any of your applications.

How to run

from logEZ import MyLogger

logger = MyLogger()

MyLogger()

The init method of class MyLogger takes four default arguments. log_file_name, logging_level, disable_console_logs and disable_file_logs

The default values are

log_file_name="logEZ.log",
logging_level="INFO",
disable_console_logs=False,
disable_file_logs=False
  • log_file_name

    You can specify the file name of your log file here.

  • logging_level

    You can specify the default logging level of your logs.

    It can be INFO, DEBUG, WARNING, ERROR or CRITICAL

  • disable_console_logs

    This disables the console logging of your logs, if set True.

  • disable_file_logs

    This disables the file logging of your logs, if set True.

Methods

Once you have an object initialized, you can use the following methods.

  • setLoggingLevel(level): To change the logging level after initializing MyLogger(). (Refer logging_level under MyLogger() for levels)
  • myDebug(str): To print a debug log. Accepts string input.
  • myInfo(str): To print an info log. Accepts string input.
  • myWarn(str): To print a warning log. Accepts string input.
  • myError(str, exc_info[Optional]): To print an error log. Accepts string input. If exc_info is set True, it appends complete execution information along with the log string.
  • myCrit(strm exc_info[Optional]): To print an error log. Accepts string input. If exc_info is set True, it appends complete execution information along with the log string.
  • myExcept(str): To print an exception log. Accepts string input.

Change Log

0.0.1 (05/08/2022)

  • First Release
  • Removed requirements.txt
  • Removed logging from install_requires

0.0.2 (05/08/2022)

Fixing project directory name

0.0.3 (05/08/2022)

Updated code with method name fix and logging level method. Added How to use with complete method definition in readme.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

logEZ-0.0.3.tar.gz (3.9 kB view details)

Uploaded Source

File details

Details for the file logEZ-0.0.3.tar.gz.

File metadata

  • Download URL: logEZ-0.0.3.tar.gz
  • Upload date:
  • Size: 3.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.9.12

File hashes

Hashes for logEZ-0.0.3.tar.gz
Algorithm Hash digest
SHA256 43445a31612322f835ae078965c70a2678fa2c008d24ad3be68111a135b74fa2
MD5 a44eb6e36e2a67e4d5a6c13a4542e824
BLAKE2b-256 d018ff1e2520f50024603ef01076630dea899143196da03bd76a65f4cc996cf8

See more details on using hashes here.

Provenance

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page