Added v2 version of logger function to print thread id. corresponding
changes to the header file and macros.