changed how logging works to be a bit more efficient