Change errorlog format

Added thread id to log output.

New log format for errors is:
[Thread 1]
function() path/to/source.c:99
Error 6 - Error description

The thread with number 1 is the main thread.