log buffer to string