Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(21)

Side by Side Diff: pkg/polymer/lib/src/build/log_injector.dart

Issue 543963002: Link to stable-errors site from pub-build messages on the command line. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « pkg/polymer/lib/src/build/linter.dart ('k') | pkg/polymer/lib/src/build/messages.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 /// This library provides a single function called injectLogs which when called 5 /// This library provides a single function called injectLogs which when called
6 /// will request a logs json file and build a small widget out of them which 6 /// will request a logs json file and build a small widget out of them which
7 /// groups the logs by level. 7 /// groups the logs by level.
8 library polymer.build.log_injector; 8 library polymer.build.log_injector;
9 9
10 import 'dart:async'; 10 import 'dart:async';
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
84 menuItem.classes.toggle('active'); 84 menuItem.classes.toggle('active');
85 contentItem.classes.toggle('active'); 85 contentItem.classes.toggle('active');
86 }); 86 });
87 87
88 // Add the logs to the content item. 88 // Add the logs to the content item.
89 for (var log in logs) { 89 for (var log in logs) {
90 var logHtml = new StringBuffer(); 90 var logHtml = new StringBuffer();
91 logHtml.write('<div class="log">'); 91 logHtml.write('<div class="log">');
92 92
93 var id = log.message.id; 93 var id = log.message.id;
94 var hashTag = 'msg_${id.package}_${id.id}'; 94 var hashTag = '${id.package}_${id.id}';
95 var message = new HtmlEscape().convert(log.message.snippet); 95 var message = new HtmlEscape().convert(log.message.snippet);
96 message.replaceAllMapped(_urlRegex, 96 message.replaceAllMapped(_urlRegex,
97 (m) => '<a href="${m.group(0)}" target="blank">${m.group(0)}</a>'); 97 (m) => '<a href="${m.group(0)}" target="blank">${m.group(0)}</a>');
98 logHtml.write('<div class="message $levelClassName">$message ' 98 logHtml.write('<div class="message $levelClassName">$message '
99 '<a target="blank" href=' 99 '<a target="blank" href='
100 '"/packages/polymer/src/build/generated/messages.html#$hashTag">' 100 '"/packages/polymer/src/build/generated/messages.html#$hashTag">'
101 '(more details)</a></div>'); 101 '(more details)</a></div>');
102 var span = log.span; 102 var span = log.span;
103 if (span != null) { 103 if (span != null) {
104 logHtml.write('<div class="location">'); 104 logHtml.write('<div class="location">');
(...skipping 20 matching lines...) Expand all
125 125
126 document.body.append(wrapperDiv); 126 document.body.append(wrapperDiv);
127 } 127 }
128 128
129 } 129 }
130 130
131 final _urlRegex = new RegExp('http://[^ ]*'); 131 final _urlRegex = new RegExp('http://[^ ]*');
132 class _OpenUriPolicy implements UriPolicy { 132 class _OpenUriPolicy implements UriPolicy {
133 bool allowsUri(String uri) => true; 133 bool allowsUri(String uri) => true;
134 } 134 }
OLDNEW
« no previous file with comments | « pkg/polymer/lib/src/build/linter.dart ('k') | pkg/polymer/lib/src/build/messages.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698