<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def command_exit(self, details):
 """ Handle the event when a utility command exits. """

        log = self._params.get('log', self._discard)
        pid = self._key
        status = details
        why = statusfmt(status)
        if status:
            log.warning("pid %d for %s(%s) %s", pid, self._name, self._handler_arg, why)
        else:
            log.info("pid %d for %s(%s) %s", pid, self._name, self._handler_arg, why)