Writes an error message to the log. Error will be written both to the log and the message file. For the log, the error will be written at the point the function is called. This function is used internally.
log_error(msg = NULL)
log_warning
to write a warning message to the log.