Right now a thread stores the logs until it finishes and then flushes them to the main log. This isn't the best case. Probably a worthwhile approach would be to store the logs for each thread in a dictionary by thread id and the thread then calls flush on end, but it adds the ability to flush on crash. Needs proper handling for subthreads though, maybe some kind of time-based dictionary or so.
Right now a thread stores the logs until it finishes and then flushes them to the main log. This isn't the best case. Probably a worthwhile approach would be to store the logs for each thread in a dictionary by thread id and the thread then calls flush on end, but it adds the ability to flush on crash. Needs proper handling for subthreads though, maybe some kind of time-based dictionary or so.