def METHOD_NAME(msg_type, msg_log_context, msg_string):
    log_fn = {
        QtDebugMsg: log.debug,
        QtInfoMsg: log.info,
        QtWarningMsg: log.warning,
    }.get(msg_type, log.error)
    details = []
    if msg_log_context.file is not None:
        details.append('%s:%u' % (msg_log_context.file, msg_log_context.line))
    if msg_log_context.function is not None:
        details.append(msg_log_context.function)
    if details:
        details = ' [%s]' % ', '.join(details)
    else:
        details = ''
    log_fn('Qt: %s%s', msg_string, details)