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

Side by Side Diff: lib/src/log.dart

Issue 2184303002: Make pub strong-mode clean. (Closed) Base URL: git@github.com:dart-lang/pub.git@master
Patch Set: Code review changes Created 4 years, 4 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
« no previous file with comments | « lib/src/lock_file.dart ('k') | lib/src/package.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) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, 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 /// Message logging. 5 /// Message logging.
6 import 'dart:async'; 6 import 'dart:async';
7 import 'dart:convert'; 7 import 'dart:convert';
8 import 'dart:io'; 8 import 'dart:io';
9 9
10 import 'package:args/command_runner.dart'; 10 import 'package:args/command_runner.dart';
(...skipping 381 matching lines...) Expand 10 before | Expand all | Expand 10 after
392 stderr.writeln('---- End log transcript ----'); 392 stderr.writeln('---- End log transcript ----');
393 } 393 }
394 394
395 /// Prints [message] then displays an updated elapsed time until the future 395 /// Prints [message] then displays an updated elapsed time until the future
396 /// returned by [callback] completes. 396 /// returned by [callback] completes.
397 /// 397 ///
398 /// If anything else is logged during this (including another call to 398 /// If anything else is logged during this (including another call to
399 /// [progress]) that cancels the progress animation, although the total time 399 /// [progress]) that cancels the progress animation, although the total time
400 /// will still be printed once it finishes. If [fine] is passed, the progress 400 /// will still be printed once it finishes. If [fine] is passed, the progress
401 /// information will only be visible at [Level.FINE]. 401 /// information will only be visible at [Level.FINE].
402 Future progress(String message, Future callback(), {bool fine: false}) { 402 Future/*<T>*/ progress/*<T>*/(String message, Future/*<T>*/ callback(),
403 {bool fine: false}) {
403 _stopProgress(); 404 _stopProgress();
404 405
405 var progress = new Progress(message, fine: fine); 406 var progress = new Progress(message, fine: fine);
406 _animatedProgress = progress; 407 _animatedProgress = progress;
407 return callback().whenComplete(progress.stop); 408 return callback().whenComplete(progress.stop);
408 } 409 }
409 410
410 /// Stops animating the running progress indicator, if currently running. 411 /// Stops animating the running progress indicator, if currently running.
411 void _stopProgress() { 412 void _stopProgress() {
412 if (_animatedProgress != null) _animatedProgress.stopAnimating(); 413 if (_animatedProgress != null) _animatedProgress.stopAnimating();
(...skipping 239 matching lines...) Expand 10 before | Expand all | Expand 10 after
652 message(_firstMessage); 653 message(_firstMessage);
653 } else { 654 } else {
654 message(_template.replaceAll("##", _count.toString())); 655 message(_template.replaceAll("##", _count.toString()));
655 } 656 }
656 } 657 }
657 658
658 void _initTimer() { 659 void _initTimer() {
659 _timer = new Timer(_window, end); 660 _timer = new Timer(_window, end);
660 } 661 }
661 } 662 }
OLDNEW
« no previous file with comments | « lib/src/lock_file.dart ('k') | lib/src/package.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698