Skip to main content

Logger for Python functions which automatically captures input arguments and the return value, plus marked intermediate variables, with minimal boilerplate.

Project description

Decorator Logger

The problem

  • Existing logging libraries are geared towards logging for long-running services

  • Sometimes we write code to execute a routine, more like a script. This library aims to be a convenient logger for these functions with minimal boilerplate.

  • We often repeat the same analysis routine for many datasets.

  • Often we require not only the final output of the routine, but wish to log intermediate values.

  • If we compare two results, we need to know whether the analysis code was the same or different. (Most obvious way to do this is to compare code version, however it is not always this simple.)

  • Logging should be easy and not require the user to have to figure out correct paths to store results.

The solution

  • Decorate the 'main' function which is the top level entry point to the analysis routine.
  • All settings should be managed in the arguments supplied to the function, which allows them to be captured by the decorator.
  • Logging is still achieved simply with the log function, which will ascend the call stack until it reaches the __call__ method of the Logger at which point the Logger will handle the logged variable.

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

declog-0.1.0.tar.gz (8.2 kB view details)

Uploaded Source

Built Distribution

declog-0.1.0-py3-none-any.whl (5.2 kB view details)

Uploaded Python 3

File details

Details for the file declog-0.1.0.tar.gz.

File metadata

  • Download URL: declog-0.1.0.tar.gz
  • Upload date:
  • Size: 8.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.16

File hashes

Hashes for declog-0.1.0.tar.gz
Algorithm Hash digest
SHA256 3b7e1eaae4e666c1be5d6df9d8b3a2e75b974470de5e593a33aed69e634dcf1a
MD5 ed9379364a47bcc970d58c893c71e8bd
BLAKE2b-256 4605896f6a1f6bbb59a04cc257470f77889770c45399546ff677ad61f25940d8

See more details on using hashes here.

File details

Details for the file declog-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: declog-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 5.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.16

File hashes

Hashes for declog-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 1e87d3ed0042e58e252869a1ab37e2c4d9e8e94db44750b4e03b3c96485d21fd
MD5 377aaf38b90f6ee72f77d17e84490e0a
BLAKE2b-256 6292c3593c4d8526e2aadb4fa177d733cd856f294826b004272ba49bd6a75db0

See more details on using hashes here.

Supported by

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