<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def excepthook(type, value, traceback):
 # pylint: disable=unused-argument """Log exceptions instead of printing a traceback to stderr."""

    try:
        six.reraise(type, value, traceback)
    except type:
        _LOGGER.exception(str(value))
    if isinstance(value, KeyboardInterrupt):
        message = "Cancelling at the user's request."
    else:
        message = handle_unexpected_exception(value)
    print(message, file=sys.stderr)