Skip to main content

Autologging is a module containing decorators and a metaclass used to make logging classes easier.

Project description

Autologging provides two decorators and a metaclass factory:

@logged
- creates a class-level '__logger' member
- the logger is automatically named to match the dotted-name of the class

@traced
- decorates a module-level function to provide call/return tracing
- log record attributes (pathname, filename, lineno, module, funcName)
are correctly preserved (i.e. they refer to the original function, NOT
the proxy function returned by the decorator)

TracedMethods
- creates a metaclass that adds automatic tracing to specified class
methods (just like @traced does for module-level functions)
- log record attributes (pathname, filename, lineno, module, funcName)
are correctly preserved (i.e. they refer to the original class method,
NOT the proxy method installed by the metaclass)

Additionally, the autologging module defines and registers a custom
log level named "TRACE" (level 1) so that tracing messages can be
toggled on/off independently of DEBUG-level logging.

Autologging runs on Python 2.7 and 3.2+.

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

Autologging-0.2.1.tar.gz (95.8 kB view details)

Uploaded Source

File details

Details for the file Autologging-0.2.1.tar.gz.

File metadata

  • Download URL: Autologging-0.2.1.tar.gz
  • Upload date:
  • Size: 95.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for Autologging-0.2.1.tar.gz
Algorithm Hash digest
SHA256 48fc93615bf7a864fda6b300e25cf8ea033267e86fca14c4fcc08bd8fbff9bc3
MD5 768839433e28a2c75bd5192862f5a550
BLAKE2b-256 dd79fee9f9839d8105f0a1a5f0b293f23f4d1cb2715c1a0adaf9b032c7339837

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