os._exit used instead of sys.exit in threads.

console logging added.