title: Change a redirect_stdout context
body: <p>For context, I'm using multiprocessing and running several child processes, which may print on stdout the logs of what they are doing. Since they may print at the same time, resulting in very messy logs, I'm using a</p>
  <pre><code>from contextlib import redirect_stdout
  
  for task in task_list:
      with redirect_stdout(buffer):
          (do some stuff)
      with lock_stdout:
          print(buffer)
  </code></pre>
  <p>structure. This way, they only print after they have finished a task, and this works fine. Now, under some particular conditions, I want to be able to print something on stdout inside this context marked with &quot;(do some stuff)&quot;, but the only way I have been able to print anything to stdout is through the use of warnings, which is very dirty. Is there an elegant way to redirect stdtout back to stdout for a while?</p>