def _make_record(self,
                     level,
                     fmt,
                     args,
                     extra,
                     exc_info,
                     inc_stackinfo,
                     inc_multiproc):
        """ Create a 'record' (a dictionary) with information to be logged. """

        fn = fname = '(unknown file)'
        lno = 0
        func = '(unknown function)'
        code = '(code not available)'
        cc = []
        sinfo = None
        module = '(unknown module)'
        if _srcfile and inc_stackinfo:
            #IronPython doesn't track Python frames, so _find_caller throws an
            #exception on some versionf of IronPython. We trap it here so that
            #IronPython can use logging.
            try:
                fn, lno, func, code, cc, sinfo = self._find_caller()
                fname = os.path.basename(fn)
                module = os.path.splitext(fname)[0]
            except ValueError:
                pass

        if not exc_info or not isinstance(exc_info, tuple):
            # Allow passed in exc_info, but supply it if it isn't
            exc_info = sys.exc_info()

        log_record = { # This is available information for logging functions.
            #TODO:  proc_name, thread_name
            # see http://hg.python.org/cpython/file/74fa415dc715/Lib/logging/__init__.py#l279
            'asctime': time.asctime(), # TODO: actual specifier for format
            'code': code,
            'codecontext': ''.join(cc),
            'excinfo' : exc_info,
            'filename' : fname,
            'funcname' : func,
            'levelname' : level,
            'levelno' : ALL.index(level),
            'lineno' : lno,
            'logmessage' : None,
            'messagefmt' : fmt,
            'module' : module,
            'pathname' : fn,
            'process' : os.getpid(),
            'processname' : None,
            'stackinfo' : sinfo,
            'threadid' : None,
            'threadname' : None,
            'time' : time.time(),
            # The custom `extra` information can only be used to format the
            # default format. The `logmessage` can only be passed a dictionary
            # or a list (as `args`).
            'defaultfmt' : self.config['defaultfmt']
        }
        # If the user passed a single dict, use that with format.  If we're
        # passed a tuple or list, dereference its contents as args to format,
        # too. Otherwise, leave the log message as None.
        if args:
            if (isinstance(args, (tuple, list)) and
                len(args) == 1 and
                isinstance(args[0], dict)):
                log_record['logmessage'] = fmt.format(**args[0])
            else:
                log_record['logmessage'] = fmt.format(*args)
        else:
            log_record['logmessage'] = fmt

        if extra:
            log_record.update(extra) # add custom variables to record

        if threading: # check to use threading
            curthread = threading.current_thread()
            log_record.update({
                'threadid' : curthread.ident,
                'threadname' : curthread.name
            })

        if not inc_multiproc: # check to use multiprocessing
            procname = None
        else:
            procname = 'MainProcess'
            if mp:
                try:
                    procname = mp.curent_process().name
                except StandardError:
                    pass
        log_record['processname'] = procname

        return log_record
Create a 'record' (a dictionary) with information to be logged.