def webhook_hdlr(url, host='localhost', port=None, get=False, **kwargs):
    """A web log handler

    Args:
        url (string): The logging endpoint.

        host (string): The host name (default: localhost).

        port (int): The port (default: None).

        get (bool): Use a GET request instead of POST (default: False).

    Returns:
        New instance of :class:`logging.handlers.HTTPHandler`

    Examples:
        >>> webhook_hdlr('api/log', 'mysite.com')  # doctest: +ELLIPSIS
        <logging.handlers.HTTPHandler object at 0x...>
    """
    method = 'GET' if get else 'POST'
    host = (host, port) % '%s:%s' if port else host
    return hdlrs.HTTPHandler(host, url, method=method)
dataset/ETHPy150Open reubano/pygogo/pygogo/handlers.py/webhook_hdlr/swapped operands of `%`