Some logs may have been left unsent on process termination. Wait with exiting the process until pipe is empty.
Tested with this block in example-project script right below logger initialization:
import threading
import time
def some_thread_function():
print("Starting thread")
time.sleep(1)
for i in range(10):
logger.debug("I am using Logtail in a thread! " + str(i))
print("Ending thread")
t = threading.Thread(target=some_thread_function, daemon=True)
t.start()
Before suggested changes, I am using Logtail in a thread! 0 was the last message send (instead of I am using Logtail in a thread! 9)
Some logs may have been left unsent on process termination. Wait with exiting the process until pipe is empty.
Tested with this block in
example-project
script right belowlogger
initialization:Before suggested changes,
I am using Logtail in a thread! 0
was the last message send (instead ofI am using Logtail in a thread! 9
)