A bit more tabular log output
Not overdoing this, but most of the time the log messages should be
aligned.
@@ -62,7 +62,7 @@ def _install_std_handler(level=False):
level = logging.getLevelName(level.upper())
formatter = TaskNumberFormatter(
- fmt="SublimeLinter: {TASK_NUMBER}{filename}:{lineno}: {LEVELNAME}{message}",
+ fmt="SublimeLinter: {LOC:<22} {LEVELNAME}{message}",
style='{')
handler = logging.StreamHandler()
handler.setFormatter(formatter)
@@ -112,6 +112,8 @@ class TaskNumberFormatter(logging.Formatter):
else:
record.LEVELNAME = ''
+ record.LOC = '{}{}:{}'.format(record.TASK_NUMBER, record.filename, record.lineno)
+
return super().format(record)
