Skip to main content

crazylog

crazylog logs like crazy. Allows to add extensive logging at each step in the python execution cycle.

Installation

You can install from pypi:

pip install -U crazylog

Or get the latest updates (Not recommended for production):

pip install -U git+https://github.com/afarntrog/crazylog.git

Quickstart

Here you can see a few samples to get a feel of whats ahead.

Basic example

from crazylog import CrazyLogger

def foo():
   print('running code ...')

with CrazyLogger() as crazy:
   foo()

Run it for specific classes only

class CustomClass:
   pass

with CrazyLogger() as crazy:
   crazy.exclusively = [CustomClass]
   foo()

Apply it manually to specific classes via metaclasses

Run the code as usual. CrazyLogger will kick in if that class is called

from crazylog import CrazyLoggerMeta

class CustomClass(metaclass=CrazyLoggerMeta):
   def printer(self):
      print('CrazyLogger is active')

def foo():
   print('CrazyLogger will do nothing')
   CustomClass().printer()

# run as usual
foo()

Apply it at the module level

apply should be added at the bottom of the module that you want it to take affect.

# my_first_module.py
from crazylog import CrazyLogger

class CustomClass():
   def printer(self):
      print('CrazyLogger is active')

def foo():
   print('CrazyLogger is active')
   CustomClass().printer()

CrazyLogger.apply(__name__)

# my_second_module.py
from my_first_module import foo

def bar():
   print('CrazyLogger is not active in this module - only in my_first_module')

foo()

# CrazyLogger only has an effect when `foo` is called.

Feedback and contributing

This library is very focused on being easy and fun to use, so if you find something that you think can be improved please open an issue or even better, a PR, thank you!

Metadata

Release files for crazylog 0.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for crazylog 0.1.1
File Size Uploaded Provenance Actions
crazylog-0.1.1.tar.gz 4.8 kB Without provenance Details for crazylog-0.1.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for crazylog 0.1.1
File Interpreter ABI Platform Actions
crazylog-0.1.1-py3-none-any.whl Python 3 none any Details for crazylog-0.1.1-py3-none-any.whl

Total release size: 10.7 kB

Release files / crazylog-0.1.1.tar.gz

Download URL crazylog-0.1.1.tar.gz
Size 4.8 kB
Tags Source
SHA-256 checksum
How to use checksums
9e5e53cf8cec892e820b91d81f21246f118b2d6c7589d119444444241cd0629e
BLAKE2b-256 checksum
How to use checksums
de02a84eecf5487040cea367ab54639def9b79b557f1591381e0899b4f90598f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.6.0 importlib_metadata/4.8.2 pkginfo/1.8.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.0

Release files / crazylog-0.1.1-py3-none-any.whl

Download URL crazylog-0.1.1-py3-none-any.whl
Size 5.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
af7c05810ae968982f307b4f690911518eee2604ad0bb0291fcfbbef84e9601e
BLAKE2b-256 checksum
How to use checksums
44a1aedea7dd6b0e0a161d6da69a7cea16493b1c444c315c9e80800a6dea25e5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.6.0 importlib_metadata/4.8.2 pkginfo/1.8.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.0

Security for crazylog 0.1.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page