=== modified file 'doc/changes.rst'
@@ -1,6 +1,10 @@
Version History
***************
+* Show all dispatcher logs.
+* Highlight action lines.
+* Download log file in summary page
+
.. _version_0_12:
Version 0.12 (UNRELEASED)
=== modified file 'lava_scheduler_app/logfile_helper.py'
@@ -12,17 +12,27 @@
def getDispatcherLogMessages(logfile):
logs = []
log_prefix = '<LAVA_DISPATCHER>'
- level_pattern = re.compile('....-..-.. ..:..:.. .. ([A-Z]+):')
+ action_begin = '[ACTION-B]'
+ level_pattern = re.compile('....-..-.. (..:..:.. .. ([A-Z]+): .*)')
for line in logfile:
- if not line.startswith(log_prefix):
+ # log_prefix not always start at beginning of the line
+ pos = line.find(log_prefix)
+ if (pos == -1): # log_prefix not found
continue
+ if (pos > 0): # remove log_prefix leading characters
+ line = line[pos:-1]
+
line = line[len(log_prefix):].strip()
match = level_pattern.match(line)
if not match:
continue
- if len(line) > 90:
- line = line[:90] + '...'
- logs.append((match.group(1), line))
+ line = match.group(1)
+ if len(line) > 120:
+ line = line[:120] + '...'
+ if line.find(action_begin) != -1:
+ logs.append((match.group(2), line, "action"))
+ else:
+ logs.append((match.group(2), line, ""))
return logs
class Sections:
=== modified file 'lava_scheduler_app/static/css/scheduler.css'
@@ -38,6 +38,10 @@
margin: 0;
}
+pre.action {
+ color: blue
+}
+
.logbuttons .ui-button-text {
padding: 0.1em 0.4em;
}
\ No newline at end of file
=== modified file 'lava_scheduler_app/templates/lava_scheduler_app/job.html'
@@ -18,7 +18,9 @@
<pre>{{ job_errors }}</pre>
</div>
{% endif %}
-<h3>Dispatcher Log messages (file size = {{ job_file_size|filesizeformat }})</h3>
+<h3>Dispatcher Log messages (file size = {{ job_file_size|filesizeformat }})
+ <a href="{% url lava.scheduler.job.log_file.plain job.pk %}">Download as text file</a>
+</h3>
<span class="logbuttons">
{% for level in levels %}
{% if level.1 %}
@@ -30,7 +32,7 @@
</span>
<div id="log-messages">
{% for log in job_log_messages %}
-<pre class="log {{log.0}}">{{ log.1 }}</pre>
+<pre class="log {{log.0}} {{log.2}}">{{ log.1 }}</pre>
{% endfor %}
{% if job.status == job.RUNNING %}
<img src="{{ STATIC_URL }}lava_scheduler_app/images/ajax-progress.gif"/>
=== modified file 'lava_scheduler_app/views.py'
@@ -308,7 +308,7 @@
levels = defaultdict(int)
for kl in ['DEBUG', 'INFO', 'WARNING', 'ERROR', 'CRITICAL']:
levels[kl] = 0
- for level, msg in job_log_messages:
+ for level, msg, _ in job_log_messages:
levels[level] += 1
levels = sorted(levels.items(), key=lambda (k,v):logging._levelNames.get(k))
data.update({