Skip to main content

Comment-driven python loggin package

Project description

Logger LOCO

LoCo = log via comments
Python >= 3.6 only

Usage:

import logging
from logger_loco import loco

logger = logging.getLogger('mylogger')

@loco(logger)
def somefunc(a, b):
  # This is a regular comment

  c = a + b 

  #@ This is debug  
  #- This is info 
  #! This is warning
  #X This is error

  #@ You could also use variables interpolation: {a} + {b} = {c}

  #-->
  #@ This is indented log
  #-->
  #@ This is deeper indented log
  #<--
  #<--
  #@ This is not indented log

somefunc(1, 2)

@loco(logger)
class Someclass(object):
  def mymethod(self):
    #@ Also works with classes
    pass

Someclass().mymethod()

Will print:

DEBUG: This is debug
INFO: This is info
WARNING: This is warning
ERROR: This is error
DEBUG: You could also use variables interpolation: 1 + 2 = 3
DEBUG:   This is indented log
DEBUG:     This is deeper indented log
DEBUG: This is not indented log
DEBUG: Also works with classes

Development

Deploy package to <test.pypi.org>:

python3 setup.py sdist
python3 -m twine upload ---repository-url https://test.pypi.org/legacy/ dist/*

Deploy package to <pypi.org>:

rm -rf dist/
python3 setup.py sdist
python3 -m twine upload dist/*

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

logger-loco-0.1.7.tar.gz (3.0 kB view details)

Uploaded Source

Built Distribution

logger_loco-0.1.7-py3.7.egg (5.6 kB view details)

Uploaded Source

File details

Details for the file logger-loco-0.1.7.tar.gz.

File metadata

  • Download URL: logger-loco-0.1.7.tar.gz
  • Upload date:
  • Size: 3.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.6.1 requests/2.25.1 setuptools/51.1.1 requests-toolbelt/0.9.1 tqdm/4.55.1 CPython/3.7.9

File hashes

Hashes for logger-loco-0.1.7.tar.gz
Algorithm Hash digest
SHA256 4df6f06ac2a80281a49ebcd8377d2bb0fbc18e4627e25853d711ef30e8bc49f5
MD5 c7b062d87689af03da7fcdb2d2ff6780
BLAKE2b-256 6b44661095e459cdd30e312bdba7efdfa21fe4711cc1477a8b0947a18f0b2dd9

See more details on using hashes here.

File details

Details for the file logger_loco-0.1.7-py3.7.egg.

File metadata

  • Download URL: logger_loco-0.1.7-py3.7.egg
  • Upload date:
  • Size: 5.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.6.1 requests/2.25.1 setuptools/51.1.1 requests-toolbelt/0.9.1 tqdm/4.55.1 CPython/3.7.9

File hashes

Hashes for logger_loco-0.1.7-py3.7.egg
Algorithm Hash digest
SHA256 12d5be3dbcd03eb68fe713042624b6f3938bfe242fee1b7bf0e8e36e3afc6a39
MD5 2aa5d7311e944532f233306ae1111881
BLAKE2b-256 f43f29a131ad115314f7c28c66c69c959ccf7ec1c6775aa84faccab33224a1aa

See more details on using hashes here.

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