Use the util.format_fname function to format the logging location

This commit is contained in:
mvantellingen
2011-02-13 21:20:20 +01:00
parent 5eb0ddbc4e
commit 059e835b11
2 changed files with 5 additions and 2 deletions

View File

@@ -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,
})

View File

@@ -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>