nowfound

Dev tools · December 2, 2023

Python decorator to log local variables with each line of code run

Print each local variable and line of code at execution

Python decorator to log local variables with each line of code run launched on December 2, 2023 with 42 votes, #750 of 3,780 launches that month and more than 90% of that year's launches. The site was still online in September 2026, 2 years on.

Visit pypi.org ↗Alternativestop 20% of December 2023

In plain words

This Python decorator automatically logs local variables at each line of code execution. It helps developers debug by tracking variable values throughout function runs. The tool is aimed at Python developers who need detailed visibility into program state during execution. It installs via PyPI and integrates directly into code through decorator syntax.

written from the facts on this page · September 2026

From the sources

I wrote this before I learnt about Snoop : https://github.com/alexmojaki/snoop a much polished version of the same concept and implementation with an additional set of debug tools. Tag your functions with the @tracelogger decorator to be logged line-by-line. Optionally provide a function as the printer argument that takes the local variable dictionary and returns a string. This allows the customisation of which variables and how you want to print at each line. See the example with the provided names_printer function that only prints a selected set of variables. The second width parameter determines the maximum character number for each line of code defaulting to 80 . Join the Code Quality…from pypi.org

Does a similar job

all alternatives →
  • Python decorator that enables arbitrarily-deep tail/non-tail recursion2021 · github.com · ▲119

    Contribute to tylerhou/fiber development by creating an account on GitHub.

  • Trace the local context of Python functions with just a decorator2016 · github.com · ▲5

    Trace the local context of a Python function's execution with just a decorator. - mihneadb/python-execution-trace

  • utile2021 · pypi.org · ▲65

    Python library which helps in codeflow using decorators

  • Pyp – Easily, magically, run Python at the shell2020 · github.com · ▲285

    Easily run Python at the shell! Magical, but never mysterious. - hauntsaninja/pyp

  • LL
    Localscope–Limit scope of Python functions for reproducible execution2025 · localscope.readthedocs.io · ▲67

    localscope is a small Python package that disassembles functions to check if they access global variables they shouldn't. I wrote this a few years ago to detect scope bugs which are common in Jupyter notebooks. It's recently come in handy writing jax code (https://github.com/jax-ml/jax) because it requires pure functions. Thought I'd share.

  • Leaping – Debug Python tests instantly with an LLM debugger2024 · github.com · ▲120

    Hi HN! We’re Adrien and Kanav. We met at our previous job, where we spent about a third of our lives combating a constant firehose of bugs. In the hope of reducing this pain for others in the future, we’re working on automating debugging. We’re currently working on a platform that ingests logs and then automatically reproduces, root causes and ultimately fixes production bugs as they happen. You can see some of our work on this here - https://news.ycombinator.com/item?id=39528087 As we were building the root-cause phase of our automated debugger, we realized that we developed…

More dev tools this month

the category →
  • /dev/null▲490

    a social network for devs

    Dev tools · 4d ago · dev-null.sh

  • open-source IDE for thoughtful software design. Contribute to devdotfast/whiteboard development by creating an account on GitHub.

    Dev tools · 28d ago · github.com

  • Contribute to reladraw/reladraw development by creating an account on GitHub.

    Dev tools · 26d ago · github.com

  • OpenBot▲362

    Grok Bot alternative: free, local, open-source, multiplayer

    Dev tools · 23d ago · openbot.run

  • Talanoa▲346

    Hi HN, I’m a fullstack developer, and honestly, I’ve lost count of how many side projects I’ve worked on over the years. But one idea kept coming back to me: a different kind of email client. It first came to me in 2014: “What if we could handle emails more like conversations?” Every year, I’d revisit this concept in my “Build Notes.” Ten years later, no one had built exactly what I had in mind — so I finally decided to do it myself. That’s how Talanoa was born. I wanted something focused on people, not timelines. I was tired of marking messages as unread just to remember to reply later, or…

    Dev tools · 21d ago · talanoa.email

  • CoreSpeed▲332

    One MCP for everything your agents need: apps, memory, tools

    Dev tools · 29d ago · corespeed.io

Source: Show HN post ↗

Launched alongside, December 2023

the whole month →
  • Hi HN! I’m proud to share that we have built a real 3rd party iMessage client for Android. We did it by reverse engineering the iMessage protocol and encryption system. It's available to download today (no waitlist): https://play.google.com/store/apps/details?id=com.beeper.ima and there's a technical writeup here: https://blog.beeper.com/p/how-beeper-mini-works. Unlike every other attempt to build an iMessage app for Android (including our first gen app), Beeper Mini does not use a Mac server relay in the cloud. The app connects directly to Apple…

    Work · 2023 · beeper.com

  • Hey! I made Heynote entirely for my own use case. For many years, I always had an Emacs instance running with the scratch buffer open, even long after I had abandoned Emacs as my programming editor in favor of more recent IDE:s. The simplicity of having just one big scratch buffer appeals to me, but I still want to separate the different things I jot down somehow (without using tabs or similar). Previously, my solution was to insert a bunch of blank lines between the notes, but hitting C-A would still select the entire buffer. That's why I came up with the concept of "blocks", which turned…

    Work · 2023 · heynote.com

  • LogoFast▲988

    Make beautiful logos with AI, fast & free

    AI · 2023 · logofa.st

  • FuseBase▲939

    Client collaboration platform for professional services

    Dev tools · 2023 · thefusebase.com

  • Beep! 2.0▲871

    Fastest tool to assign and share visual tasks with your team

    Work · 2023 · justbeepit.com

  • Clean Up Your Inbox In Minutes Newsletter management, AI automation, and email analytics. Inbox Zero is the open-source email app that puts you back in control of your inbox.

    AI · 2023 · getinboxzero.com