This issue tracker has been migrated to GitHub ,
and is currently read-only.
For more information,
see the GitHub FAQs in the Python's Developer Guide.
Created on 2010年02月07日 05:10 by methane, last changed 2022年04月11日 14:56 by admin. This issue is now closed.
| Files | ||||
|---|---|---|---|---|
| File name | Uploaded | Description | Edit | |
| logging_show_file_and_line.patch | methane, 2010年02月07日 05:12 | |||
| Messages (3) | |||
|---|---|---|---|
| msg98981 - (view) | Author: Inada Naoki (methane) * (Python committer) | Date: 2010年02月07日 05:10 | |
When exception raised in logging, traceback is shown but it doesn't tell
me which logging code cause the error.
$ cat unusable_traceback.py
import logging
logging.warn('%s %s', 1) # not enough arguments.
$ python unusable_traceback.py
Traceback (most recent call last):
File "/usr/lib/python2.6/logging/__init__.py", line 768, in emit
msg = self.format(record)
File "/usr/lib/python2.6/logging/__init__.py", line 648, in format
return fmt.format(record)
File "/usr/lib/python2.6/logging/__init__.py", line 436, in format
record.message = record.getMessage()
File "/usr/lib/python2.6/logging/__init__.py", line 306, in getMessage
msg = msg % self.args
TypeError: not enough arguments for format string
|
|||
| msg98982 - (view) | Author: Inada Naoki (methane) * (Python committer) | Date: 2010年02月07日 05:12 | |
This patch shows filename and lineno. I can specify my wrong logging code with this patch. |
|||
| msg98996 - (view) | Author: Vinay Sajip (vinay.sajip) * (Python committer) | Date: 2010年02月07日 12:59 | |
Fix (slightly modified version of patch) checked into trunk (r78081), thanks Inada Naoki! |
|||
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2022年04月11日 14:56:57 | admin | set | github: 52117 |
| 2010年02月07日 12:59:25 | vinay.sajip | set | status: open -> closed resolution: fixed messages: + msg98996 |
| 2010年02月07日 08:20:07 | r.david.murray | set | versions:
- Python 2.5 nosy: + vinay.sajip priority: normal type: behavior -> enhancement stage: patch review |
| 2010年02月07日 05:12:43 | methane | set | files:
+ logging_show_file_and_line.patch keywords: + patch messages: + msg98982 |
| 2010年02月07日 05:10:16 | methane | create | |