things I do

Parallel logger

Github

Pypi

Today I was running 4 jobs in parallel in python using ThreadPoolExecutor. The logs were totally incomprehensible, since they were all sending to stdout.

I decided I wanted to create something more readable, and I (for the first time!) found out about Curses, a python library that lets you interact with the terminal (to be honest: I’ve been using curses with python for years, but I’ve been cursing even more with javascript, so I don’t think that counts)

It’s not the easiest library to use, in my opinion, but it’s simple enough that I could build a simple tool that logs each thread on its own page, allowing the user to switch between pages with arrow keys.

I could have looked for something similar, I’m sure it already exists, but this one works, so I’ve published it on pypi.