working on buffered logging