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`.
436330
def dump_error_msg(msg, ofd=_LOGGER.debug):
    
    hdr = nlmsg_hdr(msg)
    err = libnl.linux_private.netlink.nlmsgerr(nlmsg_data(hdr))

    ofd('  [ERRORMSG] %d octets', err.SIZEOF)

    if nlmsg_len(hdr) >= err.SIZEOF:
        ofd('    .error = %d "%s"', err.error, os.strerror(-err.error))
        ofd('  [ORIGINAL MESSAGE] %d octets', hdr.SIZEOF)
        errmsg = nlmsg_inherit(err.msg)
        print_hdr(ofd, errmsg)
106644
def debug(msg)
      # Should probably replace with a Logger
      return unless config.debug_filename

      @debug ||= File.open(config.debug_filename, 'w')
      @debug.write("#{msg}\n")
      @debug.flush
    end
75106
def debug_print(*message):
    """"""
    warnings.warn("debug_print is deprecated; use the logging module instead.")
    if get_debug_level():
        ss = STDOUT
        if PY3:
            # This is needed after restarting and using debug_print
            for m in message:
                ss.buffer.write(str(m).encode('utf-8'))
            print('', file=ss)
        else:
            print(*message, file=ss)
532546
def debug_print_line(self, i, level, line):
        
        if self.debug_level == 2:
            print("Line %d (%d): '%s'" % (i + 1, level, line.rstrip(' \r\n\t\f')))
        if self.debug_level > 2:
            print("Line %d (%d):" % (i + 1, level))
            hexdump(line)
53679
def d(msg, *args, **kwargs):

    '''
    
    '''

    return logging.log(DEBUG, msg, *args, **kwargs)
1255563
def tokenize_ofp_instruction_arg(arg):
    
    arg_re = re.compile("[^,()]*")
    try:
        rest = arg
        result = []
        while len(rest):
            m = arg_re.match(rest)
            if m.end(0) == len(rest):
                result.append(rest)
                return result
            if rest[m.end(0)] == '(':
                this_block, rest = _tokenize_paren_block(
                    rest, m.end(0) + 1)
                result.append(this_block)
            elif rest[m.end(0)] == ',':
                result.append(m.group(0))
                rest = rest[m.end(0):]
            else:  # is ')'
                raise Exception
            if len(rest):
                assert rest[0] == ','
                rest = rest[1:]
        return result
    except Exception:
        raise ryu.exception.OFPInvalidActionString(action_str=arg)
169074
def log(msg, *args, **kwargs):
    
    if len(args) == 0 and len(kwargs) == 0:
        print(msg)
    else:
        print(msg.format(*args, **kwargs))
857129
public final static void debug(Object... msg)
    {
        if ( DEBUG.get() ) {
            StringBuilder sb = new StringBuilder();
            for ( Object m : msg )
                sb.append(m);
            Console.debug.println("// Debug: " + sb.toString());
        }
    }
1355987
def debug (logname, msg, *args, **kwargs):
    
    log = logging.getLogger(logname)
    if log.isEnabledFor(logging.DEBUG):
        _log(log.debug, msg, args, **kwargs)
570630
function debugPrintFlatScannedData(data, printer) {
        var pInfo = [
            'numConnectionTypes',
            'connectionTypeNames',
            'verifiedConnectionTypeNames',
            'connectionTypes',
            'unverifiedConnectionTypeNames',
        ];

        if(DEBUG_MARKING_ACTIVE_CONNECTION_TYPES) {
            pInfo.push('handle');
            pInfo.push('dt');
            pInfo.push('deviceType');
            pInfo.push('deviceTypeStr');
            pInfo.push('deviceTypeString');
            pInfo.push('deviceTypeName');
            pInfo.push('handleConnectionType');
            pInfo.push('handleConnectionTypeStr');
            pInfo.push('handleConnectionTypeName');
            pInfo.push('ct');
            pInfo.push('connectionType');
            pInfo.push('connectionTypeStr');
            pInfo.push('connectionTypeName');
            pInfo.push('serialNumber');
            pInfo.push('ip');
            pInfo.push('port');
            pInfo.push('maxBytesPerMB');
            pInfo.push('maxBytesPerMB');
            pInfo.push('isActive');
        }
        var pData = {};
        var keys = Object.keys(data);
        keys.forEach(function(key) {
            var dData = data[key];
            var dKeys = Object.keys(dData);
            pData[key] = {};
            var otherKeys = [];
            // loop through each available device.
            dKeys.forEach(function(dKey) {
                // Save the requested key's info.
                if(pInfo.indexOf(dKey) >= 0) {
                    pData[key][dKey] = dData[dKey];
                } else {
                    otherKeys.push(dKey);
                }
            });
            // pData[key].keys = otherKeys;
        });
        if(printer) {
            printer('Scanned Data', pData);
        } else {
            console.log('Scanned Data', pData);
        }
    }
568214
def get_deprecated_msg(self, wrapped, instance):
        
        if instance is None:
            if inspect.isclass(wrapped):
                fmt = "Call to deprecated class {name}."
            else:
                fmt = "Call to deprecated function (or staticmethod) {name}."
        else:
            if inspect.isclass(instance):
                fmt = "Call to deprecated class method {name}."
            else:
                fmt = "Call to deprecated method {name}."
        if self.reason:
            fmt += " ({reason})"
        if self.version:
            fmt += " -- Deprecated since version {version}."
        return fmt.format(name=wrapped.__name__,
                          reason=self.reason or "",
                          version=self.version or "")
711974
public void debug(String format, Object arg1, Object arg2) {
        if (!logger.isDebugEnabled())
            return;

        if (instanceofLAL) {
            String formattedMessage = MessageFormatter.format(format, arg1, arg2).getMessage();
            ((LocationAwareLogger) logger).log(null, fqcn, LocationAwareLogger.DEBUG_INT, formattedMessage, new Object[] { arg1, arg2 }, null);
        } else {
            logger.debug(format, arg1, arg2);
        }
    }
537757
function debugPrint(label, arr, size) {
    var msg = '\n' + label + ' = ';
    for (var i = 0; i < arr.length; i += 2) {
        if (size === 32) {
            msg += uint32ToHex(arr[i]).toUpperCase();
            msg += ' ';
            msg += uint32ToHex(arr[i + 1]).toUpperCase();
        }
        else if (size === 64) {
            msg += uint32ToHex(arr[i + 1]).toUpperCase();
            msg += uint32ToHex(arr[i]).toUpperCase();
        }
        else
            throw new Error('Invalid size ' + size);
        if (i % 6 === 4) {
            msg += '\n' + new Array(label.length + 4).join(' ');
        }
        else if (i < arr.length - 2) {
            msg += ' ';
        }
    }
}
1015459
def debug(message, *args, **kwargs):
    
    if 'end' in kwargs:
        end = kwargs['end']
    else:
        end = '\n'

    if DEBUG: 
        if len(args) == 0:
            sys.stderr.write(message)
        else:
            sys.stderr.write(message % args)

        sys.stderr.write(end)
        sys.stderr.flush()
213761
public static void debug(String msg, Object... args) {
		String tag = generateTag();
		if (!"".equals(tag)) {
			if (args.length > 0) {
				Log.d(tag, String.format(msg, args));
			} else {
				Log.d(tag, msg);

			}
		}
	}
685881
public void d(String msg, Throwable tr) {
    println(LogLevel.DEBUG, msg, tr);
  }
1363048
def msg(message, *args, **kwargs):
    """"""
    global log_file
    if log_file is None:
        log_file = sys.stderr
    if long_msg:
        file_name, line = caller_trace()
        file_name, file_type = os.path.splitext(file_name)
        if file_name.endswith('/__init__'):
            file_name = os.path.basename(os.path.dirname(file_name))
        elif file_name.endswith('/__main__'):
            file_name = "(-m) {0}".format(
                os.path.basename(os.path.dirname(file_name)))
        else:
            file_name = os.path.basename(file_name)
        head = '{0}{1} ({2}): '.format(file_name, file_type, line)
    else:
        head = '[SERVER] '
    out = StringIO()
    for line in message.format(*args, **kwargs).split('\n'):
        out.write('{0}{1}\n'.format(head, line))
    out.flush()
    out.seek(0)
    if _msg_stderr:
        sys.stderr.write(out.read())
        sys.stderr.flush()
    else:
        log_file.write(out.read())
        log_file.flush()
    out.close()