logError function

Log a message at the ERROR level