def findCaller(self):
    """
        Find the stack frame of the caller so that we can note the source
        file name, line number and function name.
        """
f = logging.currentframe().f_back
rv = '(unknown file)', 0, '(unknown function)'
while hasattr(f, 'f_code'):
    co = f.f_code
filename = os.path.normcase(co.co_filename)
if filename in (_srcfile, logging._srcfile):
    f = f.f_back
Как написать собственные методы логирования для собственных уровней логирования