def dump_error_msg(msg, ofd=_LOGGER.debug):
hdr = nlmsg_hdr(msg)<EOL>err = libnl.linux_private.netlink.nlmsgerr(nlmsg_data(hdr))<EOL>ofd('<STR_LIT>', err.SIZEOF)<EOL>if nlmsg_len(hdr) >= err.SIZEOF:<EOL><INDENT>ofd('<STR_LIT>', err.error, os.strerror(-err.error))<EOL>ofd('<STR_LIT>', hdr.SIZEOF)<EOL>errmsg = nlmsg_inherit(err.msg)<EOL>print_hdr(ofd, errmsg)<EOL><DEDENT>
https://github.com/thom311/libnl/blob/libnl3_2_25/lib/msg.c#L908.

    Positional arguments:
    msg -- message to print (nl_msg class instance).

    Keyword arguments:
    ofd -- function to call with arguments similar to `logging.debug`.