add level to error logging