mirror of
https://github.com/pallets-eco/flask-debugtoolbar.git
synced 2026-01-05 21:20:12 -06:00
Use the util.format_fname function to format the logging location
This commit is contained in:
@@ -4,7 +4,9 @@ try:
|
||||
import threading
|
||||
except ImportError:
|
||||
threading = None
|
||||
|
||||
from flaskext.debugtoolbar.panels import DebugPanel
|
||||
from flaskext.debugtoolbar.utils import format_fname
|
||||
|
||||
_ = lambda x: x
|
||||
|
||||
@@ -72,7 +74,8 @@ class LoggingPanel(DebugPanel):
|
||||
'message': record.getMessage(),
|
||||
'time': datetime.datetime.fromtimestamp(record.created),
|
||||
'level': record.levelname,
|
||||
'file': record.pathname,
|
||||
'file': format_fname(record.pathname),
|
||||
'file_long': record.pathname,
|
||||
'line': record.lineno,
|
||||
})
|
||||
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
<td>{{ record.level }}</td>
|
||||
<td>{{ record.time }}</td>
|
||||
<td>{{ record.message }}</td>
|
||||
<td>{{ record.file }}:{{ record.line }}</td>
|
||||
<td title="{{ record.file_long }}:{{ record.line }}">{{ record.file }}:{{ record.line }}</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
|
||||
Reference in New Issue
Block a user