Merge lp:~le-chi-thu/lava-scheduler/improve-log-summary-page into lp:lava-scheduler

Proposed by Le Chi Thu
Status: Merged
Merged at revision: 155
Proposed branch: lp:~le-chi-thu/lava-scheduler/improve-log-summary-page
Merge into: lp:lava-scheduler
Diff against target: 87 lines (+23/-4)
4 files modified
doc/changes.rst (+4/-0)
lava_scheduler_app/logfile_helper.py (+11/-2)
lava_scheduler_app/static/css/scheduler.css (+4/-0)
lava_scheduler_app/templates/lava_scheduler_app/job.html (+4/-2)
To merge this branch: bzr merge lp:~le-chi-thu/lava-scheduler/improve-log-summary-page
Reviewer Review Type Date Requested Status
Linaro Validation Team Pending
Review via email: mp+97597@code.launchpad.net

Description of the change

Show all dispatcher logs. Highlight action lines. Download log file in summary page

To post a comment you must log in.
155. By Le Chi Thu <email address hidden> <email address hidden>

Merge changes from the trunk

Revision history for this message
Michael Hudson-Doyle (mwhudson) wrote :

A tweaked version of this branch is now on staging, for example http://staging.validation.linaro.org/scheduler/job/11946, for your previewing pleasure.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'doc/changes.rst'
--- doc/changes.rst 2012-03-15 01:44:09 +0000
+++ doc/changes.rst 2012-03-15 21:30:31 +0000
@@ -1,6 +1,10 @@
1Version History1Version History
2***************2***************
33
4* Show all dispatcher logs.
5* Highlight action lines.
6* Download log file in summary page
7
4.. _version_0_12:8.. _version_0_12:
59
6Version 0.12 (UNRELEASED)10Version 0.12 (UNRELEASED)
711
=== modified file 'lava_scheduler_app/logfile_helper.py'
--- lava_scheduler_app/logfile_helper.py 2012-01-20 04:20:04 +0000
+++ lava_scheduler_app/logfile_helper.py 2012-03-15 21:30:31 +0000
@@ -12,17 +12,26 @@
12def getDispatcherLogMessages(logfile):12def getDispatcherLogMessages(logfile):
13 logs = []13 logs = []
14 log_prefix = '<LAVA_DISPATCHER>'14 log_prefix = '<LAVA_DISPATCHER>'
15 action_begin = '[ACTION-B]'
15 level_pattern = re.compile('....-..-.. ..:..:.. .. ([A-Z]+):')16 level_pattern = re.compile('....-..-.. ..:..:.. .. ([A-Z]+):')
16 for line in logfile:17 for line in logfile:
17 if not line.startswith(log_prefix):18 # log_prefix not always start at beginning of the line
19 pos = line.find(log_prefix)
20 if (pos == -1): # log_prefix not found
18 continue21 continue
22 if (pos > 0): # remove log_prefix leading characters
23 line = line[pos:-1]
24
19 line = line[len(log_prefix):].strip()25 line = line[len(log_prefix):].strip()
20 match = level_pattern.match(line)26 match = level_pattern.match(line)
21 if not match:27 if not match:
22 continue28 continue
23 if len(line) > 90:29 if len(line) > 90:
24 line = line[:90] + '...'30 line = line[:90] + '...'
25 logs.append((match.group(1), line))31 if line.find(action_begin) != -1:
32 logs.append((match.group(1), line), "action")
33 else:
34 logs.append((match.group(1), line), "")
26 return logs35 return logs
2736
28class Sections:37class Sections:
2938
=== modified file 'lava_scheduler_app/static/css/scheduler.css'
--- lava_scheduler_app/static/css/scheduler.css 2011-12-09 01:53:59 +0000
+++ lava_scheduler_app/static/css/scheduler.css 2012-03-15 21:30:31 +0000
@@ -38,6 +38,10 @@
38 margin: 0;38 margin: 0;
39}39}
4040
41pre.action {
42 color: blue
43}
44
41.logbuttons .ui-button-text {45.logbuttons .ui-button-text {
42 padding: 0.1em 0.4em;46 padding: 0.1em 0.4em;
43}47}
44\ No newline at end of file48\ No newline at end of file
4549
=== modified file 'lava_scheduler_app/templates/lava_scheduler_app/job.html'
--- lava_scheduler_app/templates/lava_scheduler_app/job.html 2012-01-11 22:20:43 +0000
+++ lava_scheduler_app/templates/lava_scheduler_app/job.html 2012-03-15 21:30:31 +0000
@@ -18,7 +18,9 @@
18<pre>{{ job_errors }}</pre>18<pre>{{ job_errors }}</pre>
19</div>19</div>
20{% endif %}20{% endif %}
21<h3>Dispatcher Log messages (file size = {{ job_file_size|filesizeformat }})</h3>21<h3>Dispatcher Log messages (file size = {{ job_file_size|filesizeformat }}) &nbsp; &nbsp;
22 <a href="{% url lava.scheduler.job.log_file.plain job.pk %}">Download as text file</a>
23</h3>
22<span class="logbuttons">24<span class="logbuttons">
23{% for level in levels %}25{% for level in levels %}
24{% if level.1 %}26{% if level.1 %}
@@ -30,7 +32,7 @@
30</span>32</span>
31<div id="log-messages">33<div id="log-messages">
32{% for log in job_log_messages %}34{% for log in job_log_messages %}
33<pre class="log {{log.0}}">{{ log.1 }}</pre>35<pre class="log {{log.0}} {{log.2}}">{{ log.1 }}</pre>
34{% endfor %}36{% endfor %}
35{% if job.status == job.RUNNING %}37{% if job.status == job.RUNNING %}
36<img src="{{ STATIC_URL }}lava_scheduler_app/images/ajax-progress.gif"/>38<img src="{{ STATIC_URL }}lava_scheduler_app/images/ajax-progress.gif"/>

Subscribers

People subscribed via source and target branches