added separation thread between console output and log output