stdlib doc for logger.findCaller() needs update.

jitudon at hotmail.com jitudon at hotmail.com
Wed May 23 07:05:25 EDT 2007


The logger objects findCaller() method  is returning a "3" element
tuple instead of "2" two as
documented in the 2.4.4 Python Library Reference .DocString is showing
it correctly.

findCaller()
    Finds the caller's source filename and line number. Returns the
filename and line number as a 2-element tuple.

[jnair at sunazaki python]$ python
Python 2.4.4 (#1, Feb  2 2007, 17:43:17)
[GCC 3.4.3 20041212 (Red Hat 3.4.3-9.EL4)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import logging
>>> logging.basicConfig()
>>> logger = logging.getLogger()
>>> help(logger.findCaller)
Help on method findCaller in module logging:

findCaller(self) method of logging.RootLogger instance
    Find the stack frame of the caller so that we can note the source
    file name, line number and function name.

>>> logger.findCaller()
('<stdin>', 1, '?')
>>>




More information about the Python-list mailing list