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 Distributions

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

Built Distribution

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

Uploaded Python 3

File details

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

File metadata

  • Download URL: declog-0.0.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.10.6

File hashes

Hashes for declog-0.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 9e4e8d793b5ca753ed3ac03e0303fb7189ac4367d151cb24302a581ada430bad
MD5 dd83a74f8cedb1d5fadee6369a40b571
BLAKE2b-256 fbe2190b61ef98140c752d641fce916d3f7108ef9f27a4ffda24562b508d9f74

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