logentries/le_python — pull request #2 by rtrajano (2013-10-07 21:12:08+00:00)
Title: Set _started once as a property

This patch fixes this issue where it tries to start up another thread. It now checks the thread's is_alive() function first before starting another one.

Here's the stack trace I received that prompted this patch.
```python
File "/usr/lib/python2.7/logging/__init__.py", line 1160, in warning
self._log(WARNING, msg, args, **kwargs)
File "/usr/lib/python2.7/logging/__init__.py", line 1267, in _log
self.handle(record)
File "/usr/lib/python2.7/logging/__init__.py", line 1277, in handle
self.callHandlers(record)
File "/usr/lib/python2.7/logging/__init__.py", line 1317, in callHandlers
hdlr.handle(record)
File "/usr/lib/python2.7/logging/__init__.py", line 748, in handle
self.emit(record)
File "/home/rigel/.virtualenvs/dev_project_1/local/lib/python2.7/site-packages/logentries/utils.py", line 119, in emit
self._thread.start()
File "/usr/lib/python2.7/threading.py", line 489, in start
raise RuntimeError("threads can only be started once")
RuntimeError: threads can only be started once
```