TODO updated
added ability to specify message prefix when logging errors