Is there a way to alter the print statement in Python to include the thread name before any printed message?
Currently my print statements look like
print("[%s] Some text... " % self.name)
>> [thread_name] Some text...
I have a multithreaded web server where I track some behavior from each thread and it quickly gets tedious adding the above pattern to each print statement. Is there a quick way to redefine the print()
function like this?