python : print output of each thread to seperate file
问题 I have several threads and each thread writes output to stdout. However I want to redirect the ouput of each thread to a separate file independently of each other. What I mean is the following: Thread1 writes every print, every exception and every other ouput into file1.log Thread2 writes every print, every exception and every other ouput into file2.log and so on. So what I'm looking for is to set the stdout for each thread exclusivly. However setting the stdout only works globally mean that