from threading import Thread
try:
    from queue import Queue
except ImportError:  # python 2
    from Queue import Queue


class ElemThread(Thread):
    """A thread for logging as to not disrupt the logged application"""

    def __init__(self, elem, name="Elementary Logger"):
        """Construct a thread for logging

        :param elem: An Elementary instance to handle logging
        :param name: A string to represent this thread
        """
        Thread.__init__(self, name=name)
        self.daemon = True  # py2 constructor requires explicit
        self.elem = elem
        self.queue = Queue()
        self.start()

    def add(self, event):
        """Add a logged event to queue for logging"""
        self.queue.put(event)

    def run(self):
        """Main for thread to run"""
        while True:
            self.elem.write(self.queue.get())

from threading import Thread
try:
    from queue import Queue
except ImportError:  # python 2
    from Queue import Queue


class DiaryThread(Thread):
    """A thread for logging as to not disrupt the logged application"""

    def __init__(self, diary, name="Diary Logger"):
        """Construct a thread for logging

        :param diary: An Diary instance to handle logging
        :param name: A string to represent this thread
        """
        Thread.__init__(self, name=name)
        self.daemon = True  # py2 constructor requires explicit
        self.diary = diary
        self.queue = Queue()
        self.start()

    def add(self, event):
        """Add a logged event to queue for logging"""
        self.queue.put(event)

    def run(self):
        """Main for thread to run"""
        while True:
            self.diary.write(self.queue.get())

Make last changes over to diary name
Make last changes over to diary name

  from threading import Thread
  try:
      from queue import Queue
  except ImportError:  # python 2
      from Queue import Queue
  
  
- class ElemThread(Thread):
+ class DiaryThread(Thread):
      """A thread for logging as to not disrupt the logged application"""
  
-     def __init__(self, elem, name="Elementary Logger"):
+     def __init__(self, diary, name="Diary Logger"):
          """Construct a thread for logging
  
-         :param elem: An Elementary instance to handle logging
+         :param diary: An Diary instance to handle logging
          :param name: A string to represent this thread
          """
          Thread.__init__(self, name=name)
          self.daemon = True  # py2 constructor requires explicit
-         self.elem = elem
+         self.diary = diary
          self.queue = Queue()
          self.start()
  
      def add(self, event):
          """Add a logged event to queue for logging"""
          self.queue.put(event)
  
      def run(self):
          """Main for thread to run"""
          while True:
-             self.elem.write(self.queue.get())
+             self.diary.write(self.queue.get())
  
Make last changes over to diary name
## Code Before:
from threading import Thread
try:
    from queue import Queue
except ImportError:  # python 2
    from Queue import Queue


class ElemThread(Thread):
    """A thread for logging as to not disrupt the logged application"""

    def __init__(self, elem, name="Elementary Logger"):
        """Construct a thread for logging

        :param elem: An Elementary instance to handle logging
        :param name: A string to represent this thread
        """
        Thread.__init__(self, name=name)
        self.daemon = True  # py2 constructor requires explicit
        self.elem = elem
        self.queue = Queue()
        self.start()

    def add(self, event):
        """Add a logged event to queue for logging"""
        self.queue.put(event)

    def run(self):
        """Main for thread to run"""
        while True:
            self.elem.write(self.queue.get())

## Instruction:
Make last changes over to diary name
## Code After:
from threading import Thread
try:
    from queue import Queue
except ImportError:  # python 2
    from Queue import Queue


class DiaryThread(Thread):
    """A thread for logging as to not disrupt the logged application"""

    def __init__(self, diary, name="Diary Logger"):
        """Construct a thread for logging

        :param diary: An Diary instance to handle logging
        :param name: A string to represent this thread
        """
        Thread.__init__(self, name=name)
        self.daemon = True  # py2 constructor requires explicit
        self.diary = diary
        self.queue = Queue()
        self.start()

    def add(self, event):
        """Add a logged event to queue for logging"""
        self.queue.put(event)

    def run(self):
        """Main for thread to run"""
        while True:
            self.diary.write(self.queue.get())
