setlinebuf() for logger