title: Logging between classes in python
body: <p>I have three classes in python and they run in different threads. I would like to have output to the same file from all classes. Right now I created output method in main class and passing it through constructors to other classes. Is there way to handle it better? How I can pass the logger between classes except using contructors?</p>
  
  <p>Perhaps python supports something like static method in Java, so I can write like Logger.info(message) in all three classes?</p>
  
  <p>Another way probably could be redirecting global sys.stdout to the file, i.e specifying </p>
  
  <pre><code>logger = open('debug.txt', 'w')
  sys.stdout = logger
  </code></pre>
  
  <p>Then using calls sys.stdout in all classes. </p>
  
  <p>What do you think?</p>