def METHOD_NAME(msg, msg_type, is_prompt=False, **kwargs):
    json_output = getattr(logging.getLogger("borg"), "json", False)
    if json_output:
        kwargs.update(dict(type="question_%s" % msg_type, msgid=msgid, message=msg))
        print(json.dumps(kwargs), file=sys.stderr)
    else:
        if is_prompt:
            print(msg, file=ofile, end="", flush=True)
        else:
            print(msg, file=ofile)