improve thread logging