Skip to main content

An easy to use helper pip package to help you log details at any point in code.

Project description

plain_logger - Make logging simple and easy

An easy to use helper pip package to help you log details at any point in code.

Assumptions

  • Assuming python is installed on your system.

Installation

Install plain_logger on your system using :

pip install plain_logger

Usage

LogInfo

Logs data with 'INFO' tag.

LogWarn

Logs data with 'WARN' tag.

LogError

Logs data with 'ERROR' tag.

LogDebug

Logs data with 'DEBUG' tag.

LogMessage

Logs data with a custom tag.

Example

from Logger.Logger import Logger

def foo():
    try:
        fname = "John"
        lname = "Doe"
        Logger.LogInfo ("Name = {} {}".format(fname, lname))

        x = 0
        Logger.LogDebug("x = {}".format(x))

        y = -1
        Logger.LogWarn("Something may be wrong.")

        raise ValueError('A very specific bad thing happened.')

    except Exception as e:
        Logger.LogError("Exception occurred: {}".format(str(e)))

foo()

Output:

[2019-02-09 22:31:55] INFO : Test
[2019-02-09 22:31:55] WARN : Test
[2019-02-09 22:31:55] ERROR : Test
[2019-02-09 22:31:55] DEBUG : Test
[2019-02-09 22:31:55] DEBUG : Test, TAG
[2019-02-09 22:31:55] INFO : Name = John Doe
[2019-02-09 22:31:55] DEBUG : x = 0
[2019-02-09 22:31:55] WARN : Something may be wrong.
[2019-02-09 22:31:55] ERROR : Exception occurred: A very specific bad thing happened.

Project details


Download files

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

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

plain_logger-0.1.5-py3-none-any.whl (4.0 kB view details)

Uploaded Python 3

File details

Details for the file plain_logger-0.1.5-py3-none-any.whl.

File metadata

  • Download URL: plain_logger-0.1.5-py3-none-any.whl
  • Upload date:
  • Size: 4.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.31.0 CPython/3.6.2

File hashes

Hashes for plain_logger-0.1.5-py3-none-any.whl
Algorithm Hash digest
SHA256 91921e844193429881d828f69e2ab88e59b4e71c28a2eb88534db9f2c4f87d37
MD5 5c5877189bb889c9db5b860b8572680e
BLAKE2b-256 79746995a9fa8edb0f7084dda2ccf3efc4a149adfd8c829335b649567fa091ef

See more details on using hashes here.

Supported by

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