Function for attaching a debugging logger to a class or function.
546230
def bacpypes_debugging(obj):
    """"""
    # create a logger for this object
    logger = logging.getLogger(obj.__module__ + '.' + obj.__name__)

    # make it available to instances
    obj._logger = logger
    obj._debug = logger.debug
    obj._info = logger.info
    obj._warning = logger.warning
    obj._error = logger.error
    obj._exception = logger.exception
    obj._fatal = logger.fatal

    return obj
1334096
def with_log(func):
    
    @functools.wraps(func)
    def wrapper(*args, **kwargs):
        """Inject `log` argument into wrapped function.

        :param list args: Pass through all positional arguments.
        :param dict kwargs: Pass through all keyword arguments.
        """
        decorator_logger = logging.getLogger('@with_log')
        decorator_logger.debug('Entering %s() function call.', func.__name__)
        log = kwargs.get('log', logging.getLogger(func.__name__))
        try:
            ret = func(log=log, *args, **kwargs)
        finally:
            decorator_logger.debug('Leaving %s() function call.', func.__name__)
        return ret
    return wrapper
1038336
def debug(self, msg, *args, **kwargs) -> Task:  # type: ignore
        
        return self._make_log_task(logging.DEBUG, msg, args, **kwargs)
1066017
function makeLogger(level, method) {
	// The logger function to return takes a variable number of arguments
	// and formats like console.log
	function logger() {
		var args = [].slice.call(arguments);
		var format = level.toUpperCase() + ': (api-client) ' + args.shift();
		var logArgs = [format].concat(args);

		return console[method].apply(console, logArgs);
	}

	return (level === 'warn' || level === 'error' || level === 'info')
		? logger
		: function() {};
}
1350827
def log_decl_method(func):
    """"""
    from functools import wraps

    @wraps(func)
    def with_logging(*args, **kwargs):
        self = args[0]
        decl = args[2]
        log(DEBUG, u"    {}: {} {}".format(
            self.state['current_step'], decl.name,
            serialize(decl.value).strip()).encode('utf-8'))
        return func(*args, **kwargs)
    return with_logging
1101377
public void debug(Throwable throwable, String msg, Object[] argArray) {
		logIfEnabled(Level.DEBUG, throwable, msg, UNKNOWN_ARG, UNKNOWN_ARG, UNKNOWN_ARG, argArray);
	}
793890
def log(prefix = ''):
    '''

    '''

    function = None

    if inspect.isfunction(prefix):
        prefix, function = '', prefix

    def _(function):
        @functools.wraps(function, assigned = functools.WRAPPER_ASSIGNMENTS + ( '__file__', ))
        def wrapper(*args, **kwargs):
            name, my_args = function.__name__, args

            if inspect.ismethod(function):
                name = function.__self__.__class__.__name__ + '.' + function.__name__
            elif len(args):
                members = dict(inspect.getmembers(args[0], predicate = lambda _: inspect.ismethod(_) and _.__name__ == function.__name__))
                logger.debug('members.keys(): %s', members.keys())

                if len(members):
                    name, my_args = args[0].__class__.__name__ + '.' + function.__name__, args[1:]

            format_args = (
                prefix + name,
                ', '.join(list(map(str, my_args)) + [ ' = '.join(map(str, item)) for item in kwargs.items() ]),
            )

            logger.info('STARTING: %s(%s)', *format_args)

            try:
                return function(*args, **kwargs)
            except:
                logger.exception('EXCEPTION: %s(%s)', *format_args)
                raise
            finally:
                logger.info('STOPPING: %s(%s)', *format_args)

        return wrapper

    if function is not None:
        _ = _(function)

    return _
1358413
def get_class_logger(obj):
    
    return logging.getLogger(obj.__class__.__module__ + '.' + obj.__class__.__name__)
140651
def log_debug(func, *args, **kwargs):
    '''  '''
    logging.debug('Starting "%s" in thread %s...', func.__name__, current_thread())
    results = func(*args, **kwargs)
    logging.debug('Successfully finished "%s" in thread %s.', func.__name__, current_thread())
    return results
1164486
def debug(s, *args):
    """"""
    # Get the path name and line number of the function which called us.
    previous_frame = inspect.currentframe().f_back
    try:
        pathname, lineno, _, _, _ = inspect.getframeinfo(previous_frame)
        # if path is in cwd, simplify it
        cwd = os.path.abspath(os.getcwd())
        pathname = os.path.abspath(pathname)
        if os.path.commonprefix([cwd, pathname]) == cwd:
            pathname = os.path.relpath(pathname, cwd)
    except Exception:  # pylint: disable=broad-except
        pathname = '<UNKNOWN-FILE>.py'
        lineno = 0
    if _FORMATTER: # log could have not been initialized.
        _FORMATTER.pathname = pathname
        _FORMATTER.lineno = lineno
    logger = logging.getLogger(__package__)
    logger.debug(s.format(*args))
834328
public void debug(Object message, Throwable t) {
        logger.debug(String.valueOf(message), t);
    }
1359688
def get_logger(name):
    """"""
    if not hasattr(logging.Logger, 'trace'):
        logging.addLevelName(TRACE_LEVEL, 'TRACE')

        def trace(self, message, *args, **kwargs):
            if self.isEnabledFor(TRACE_LEVEL):
                # Yes, logger takes its '*args' as 'args'.
                self._log(TRACE_LEVEL, message, args, **kwargs)

        logging.Logger.trace = trace

    log = logging.getLogger(name)
    if not log.handlers:
        log.addHandler(logging.NullHandler())
    return log
957691
function log (message) {
  if (!global.testing && !global.isModuleUse) {
    console.log(message)
  } else {
    debug(message)
  }
}
1271717
function debug(message) {
            if (enplug.debug) {
                arguments[0] = TAG + arguments[0];
                console.log.apply(console, arguments);
            }
        }
719961
def debug(self, message, extra={}):
        '''
        
        '''
        if self.level_dict['DEBUG'] >= self.level_dict[self.log_level]:
            extras = self.add_extras(extra, "DEBUG")
            self._write_message(message, extras)
            self.fire_callbacks('DEBUG', message, extra)
1167065
def scope_logger(cls):
    
    cls.log = logging.getLogger('{0}.{1}'.format(cls.__module__, cls.__name__))
    return cls
1190793
public static void debug(Class<?> clazz, String message, String... values) {
        getLogger(clazz).debug(formatString(message, values));
    }