<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def _format_and_write(self, level, correlation_id, error, message, *args, **kwargs):
 """ Formats the log message and writes it to the logger destination. :param level: a log level. :param correlation_id: (optional) transaction id to trace execution through call chain. :param error: an error object associated with this message. :param message: a human-readable message to log. :param args: arguments to parameterize the message. :param kwargs: arguments to parameterize the message. """

        if message != None and len(message) > 0 and len(kwargs) > 0:
            message = message.format(*args, **kwargs)
        self._write(level, correlation_id, error, message)