Re: [Tutor] Wrong module name and line number in logging package.
Noufal Ibrahim noufal at airtelbroadband.in writes: Greetings everyone, I'm using the python standard logging package for a personal project of mine and have initialised it like so. logger = logging.getLogger(pydagogue) handler = logging.StreamHandler() handler.setFormatter(logging.Formatter([%(levelname)s]%(pathname)s:%(lineno)d %(message)s)) logger.addHandler(handler) logger.setLevel(logging.DEBUG) I think there's a bug in the module. I'm running two Ubuntu machines. One with the latest release and one with an older one. The same code runs different on both machines. On the latest one, I get wrong module names and line numbers. On the older one, it works fine. Can someone else please try this out and check if it's a problem on my end or something genuinely wrong? Thanks. ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor
[Tutor] Wrong module name and line number in logging package.
Greetings everyone, I'm using the python standard logging package for a personal project of mine and have initialised it like so. logger = logging.getLogger(pydagogue) handler = logging.StreamHandler() handler.setFormatter(logging.Formatter([%(levelname)s]%(pathname)s:%(lineno)d %(message)s)) logger.addHandler(handler) logger.setLevel(logging.DEBUG) Suppose I have a module called ui as part of this project, I want debug messages from it to be displayed like (assuming it's called from line 25) [DEBUG]ui.py:25 Debug message here. the level displays fine and so does the message. The pathname however prints the name logging/__init__.py and the lineno 1072 which I assume are from the logging module itself. Am I doing something wrong here? Peace. -- ~noufal ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor