Error logger closure