From patchwork Mon Mar 19 02:07:12 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael-Doyle Hudson X-Patchwork-Id: 7343 Return-Path: X-Original-To: patchwork@peony.canonical.com Delivered-To: patchwork@peony.canonical.com Received: from fiordland.canonical.com (fiordland.canonical.com [91.189.94.145]) by peony.canonical.com (Postfix) with ESMTP id 06DC523DEE for ; Mon, 19 Mar 2012 02:07:16 +0000 (UTC) Received: from mail-iy0-f180.google.com (mail-iy0-f180.google.com [209.85.210.180]) by fiordland.canonical.com (Postfix) with ESMTP id A48EDA1861D for ; Mon, 19 Mar 2012 02:07:15 +0000 (UTC) Received: by iage36 with SMTP id e36so11680044iag.11 for ; Sun, 18 Mar 2012 19:07:15 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-forwarded-to:x-forwarded-for:delivered-to:received-spf :content-type:mime-version:x-launchpad-project:x-launchpad-branch :x-launchpad-message-rationale:x-launchpad-branch-revision-number :x-launchpad-notification-type:to:from:subject:message-id:date :reply-to:sender:errors-to:precedence:x-generated-by :x-launchpad-hash:x-gm-message-state; bh=hUQ7uym2t1IU0DhZoQ5H4YotqnZ+6xjlJmsnBuMNb8w=; b=jJO4411amUQ408DzqdetdIHlWommy5ZMPfDv3AMn/2yKRPmYV9POo+Q039F3lzHggE XF99ycFRAno1s55GaQtkeXUdTiBy16eMdqLX0vOB8urjiBIMEwcrC3NdC9KsbtGwgKJC gWh1ycda1RzwlzR3w71kxON280QJSnj7wuQE8cQ+EdgxCkAMp6VP4flvjPg3LEoM6f0e EBJnozu+UDFqFVI6ZZ0ESJNyibdYCRtaj//vaBGhlVEuNcHXNpSTYH0F8ordyiJ/gXwJ 6A/qKR7ifJ1rCJIuXcR3QSt3XRjDf1YkCdPlXSyP8YO8jUvd0YT9mO/uktSF2iIgMQ6o ZgSA== Received: by 10.42.72.130 with SMTP id o2mr6894259icj.8.1332122835119; Sun, 18 Mar 2012 19:07:15 -0700 (PDT) X-Forwarded-To: linaro-patchwork@canonical.com X-Forwarded-For: patch@linaro.org linaro-patchwork@canonical.com Delivered-To: patches@linaro.org Received: by 10.231.203.79 with SMTP id fh15csp61917ibb; Sun, 18 Mar 2012 19:07:14 -0700 (PDT) Received: by 10.216.139.12 with SMTP id b12mr6235686wej.4.1332122833482; Sun, 18 Mar 2012 19:07:13 -0700 (PDT) Received: from indium.canonical.com (indium.canonical.com. [91.189.90.7]) by mx.google.com with ESMTPS id u51si3114156wec.29.2012.03.18.19.07.13 (version=TLSv1/SSLv3 cipher=OTHER); Sun, 18 Mar 2012 19:07:13 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of bounces@canonical.com designates 91.189.90.7 as permitted sender) client-ip=91.189.90.7; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of bounces@canonical.com designates 91.189.90.7 as permitted sender) smtp.mail=bounces@canonical.com Received: from ackee.canonical.com ([91.189.89.26]) by indium.canonical.com with esmtp (Exim 4.71 #1 (Debian)) id 1S9S08-0005ge-Tz for ; Mon, 19 Mar 2012 02:07:12 +0000 Received: from ackee.canonical.com (localhost [127.0.0.1]) by ackee.canonical.com (Postfix) with ESMTP id D6491E0768 for ; Mon, 19 Mar 2012 02:07:12 +0000 (UTC) MIME-Version: 1.0 X-Launchpad-Project: lava-scheduler X-Launchpad-Branch: ~linaro-validation/lava-scheduler/trunk X-Launchpad-Message-Rationale: Subscriber X-Launchpad-Branch-Revision-Number: 155 X-Launchpad-Notification-Type: branch-revision To: Linaro Patch Tracker From: noreply@launchpad.net Subject: [Branch ~linaro-validation/lava-scheduler/trunk] Rev 155: improve the scheduler log page (mostly ChiThu, some fixes/tweaks by mwhudson) Message-Id: <20120319020712.12359.40035.launchpad@ackee.canonical.com> Date: Mon, 19 Mar 2012 02:07:12 -0000 Reply-To: noreply@launchpad.net Sender: bounces@canonical.com Errors-To: bounces@canonical.com Precedence: bulk X-Generated-By: Launchpad (canonical.com); Revision="14969"; Instance="launchpad-lazr.conf" X-Launchpad-Hash: e99428cec1f076c802c3c3202f2e0751d8f85e82 X-Gm-Message-State: ALoCoQkbDe7bV+RCS5j+wXHO33SaNcgGniILNQuhrdy2vf6vjN91c7myX95tL5eRgWoOS8068XHJ Merge authors: Le Chi Thu le.chi.thu@linaro.org Michael Hudson-Doyle (mwhudson) Related merge proposals: https://code.launchpad.net/~le-chi-thu/lava-scheduler/improve-log-summary-page/+merge/97597 proposed by: Le Chi Thu (le-chi-thu) ------------------------------------------------------------ revno: 155 [merge] committer: Michael Hudson-Doyle branch nick: trunk timestamp: Mon 2012-03-19 15:05:32 +1300 message: improve the scheduler log page (mostly ChiThu, some fixes/tweaks by mwhudson) modified: doc/changes.rst lava_scheduler_app/logfile_helper.py lava_scheduler_app/static/css/scheduler.css lava_scheduler_app/templates/lava_scheduler_app/job.html lava_scheduler_app/views.py --- lp:lava-scheduler https://code.launchpad.net/~linaro-validation/lava-scheduler/trunk You are subscribed to branch lp:lava-scheduler. To unsubscribe from this branch go to https://code.launchpad.net/~linaro-validation/lava-scheduler/trunk/+edit-subscription === modified file 'doc/changes.rst' --- doc/changes.rst 2012-03-15 01:44:09 +0000 +++ doc/changes.rst 2012-03-15 21:27:02 +0000 @@ -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' --- lava_scheduler_app/logfile_helper.py 2012-01-20 04:20:04 +0000 +++ lava_scheduler_app/logfile_helper.py 2012-03-19 02:00:36 +0000 @@ -12,17 +12,27 @@ def getDispatcherLogMessages(logfile): logs = [] log_prefix = '' - 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' --- lava_scheduler_app/static/css/scheduler.css 2011-12-09 01:53:59 +0000 +++ lava_scheduler_app/static/css/scheduler.css 2012-03-15 09:27:48 +0000 @@ -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' --- 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 09:27:48 +0000 @@ -18,7 +18,9 @@
{{ job_errors }}
{% endif %} -

Dispatcher Log messages (file size = {{ job_file_size|filesizeformat }})

+

Dispatcher Log messages (file size = {{ job_file_size|filesizeformat }})     + Download as text file +

{% for level in levels %} {% if level.1 %} @@ -30,7 +32,7 @@
{% for log in job_log_messages %} -
{{ log.1 }}
+
{{ log.1 }}
{% endfor %} {% if job.status == job.RUNNING %} === modified file 'lava_scheduler_app/views.py' --- lava_scheduler_app/views.py 2012-03-13 03:29:49 +0000 +++ lava_scheduler_app/views.py 2012-03-19 02:01:59 +0000 @@ -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({