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
1=== modified file 'doc/changes.rst'
2--- doc/changes.rst 2012-03-15 01:44:09 +0000
3+++ doc/changes.rst 2012-03-15 21:30:31 +0000
4@@ -1,6 +1,10 @@
5 Version History
6 ***************
7
8+* Show all dispatcher logs.
9+* Highlight action lines.
10+* Download log file in summary page
11+
12 .. _version_0_12:
13
14 Version 0.12 (UNRELEASED)
15
16=== modified file 'lava_scheduler_app/logfile_helper.py'
17--- lava_scheduler_app/logfile_helper.py 2012-01-20 04:20:04 +0000
18+++ lava_scheduler_app/logfile_helper.py 2012-03-15 21:30:31 +0000
19@@ -12,17 +12,26 @@
20 def getDispatcherLogMessages(logfile):
21 logs = []
22 log_prefix = '<LAVA_DISPATCHER>'
23+ action_begin = '[ACTION-B]'
24 level_pattern = re.compile('....-..-.. ..:..:.. .. ([A-Z]+):')
25 for line in logfile:
26- if not line.startswith(log_prefix):
27+ # log_prefix not always start at beginning of the line
28+ pos = line.find(log_prefix)
29+ if (pos == -1): # log_prefix not found
30 continue
31+ if (pos > 0): # remove log_prefix leading characters
32+ line = line[pos:-1]
33+
34 line = line[len(log_prefix):].strip()
35 match = level_pattern.match(line)
36 if not match:
37 continue
38 if len(line) > 90:
39 line = line[:90] + '...'
40- logs.append((match.group(1), line))
41+ if line.find(action_begin) != -1:
42+ logs.append((match.group(1), line), "action")
43+ else:
44+ logs.append((match.group(1), line), "")
45 return logs
46
47 class Sections:
48
49=== modified file 'lava_scheduler_app/static/css/scheduler.css'
50--- lava_scheduler_app/static/css/scheduler.css 2011-12-09 01:53:59 +0000
51+++ lava_scheduler_app/static/css/scheduler.css 2012-03-15 21:30:31 +0000
52@@ -38,6 +38,10 @@
53 margin: 0;
54 }
55
56+pre.action {
57+ color: blue
58+}
59+
60 .logbuttons .ui-button-text {
61 padding: 0.1em 0.4em;
62 }
63\ No newline at end of file
64
65=== modified file 'lava_scheduler_app/templates/lava_scheduler_app/job.html'
66--- lava_scheduler_app/templates/lava_scheduler_app/job.html 2012-01-11 22:20:43 +0000
67+++ lava_scheduler_app/templates/lava_scheduler_app/job.html 2012-03-15 21:30:31 +0000
68@@ -18,7 +18,9 @@
69 <pre>{{ job_errors }}</pre>
70 </div>
71 {% endif %}
72-<h3>Dispatcher Log messages (file size = {{ job_file_size|filesizeformat }})</h3>
73+<h3>Dispatcher Log messages (file size = {{ job_file_size|filesizeformat }}) &nbsp; &nbsp;
74+ <a href="{% url lava.scheduler.job.log_file.plain job.pk %}">Download as text file</a>
75+</h3>
76 <span class="logbuttons">
77 {% for level in levels %}
78 {% if level.1 %}
79@@ -30,7 +32,7 @@
80 </span>
81 <div id="log-messages">
82 {% for log in job_log_messages %}
83-<pre class="log {{log.0}}">{{ log.1 }}</pre>
84+<pre class="log {{log.0}} {{log.2}}">{{ log.1 }}</pre>
85 {% endfor %}
86 {% if job.status == job.RUNNING %}
87 <img src="{{ STATIC_URL }}lava_scheduler_app/images/ajax-progress.gif"/>

Subscribers

People subscribed via source and target branches