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

Unified Diff: packages/cli_util/example/main.dart

Issue 2989763002: Update charted to 0.4.8 and roll (Closed)
Patch Set: Removed Cutch from list of reviewers Created 3 years, 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « packages/cli_util/analysis_options.yaml ('k') | packages/cli_util/lib/cli_logging.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: packages/cli_util/example/main.dart
diff --git a/packages/cli_util/example/main.dart b/packages/cli_util/example/main.dart
new file mode 100644
index 0000000000000000000000000000000000000000..0cc6846dc38ed2a819718ab486ac83e655a4e283
--- /dev/null
+++ b/packages/cli_util/example/main.dart
@@ -0,0 +1,25 @@
+// Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+import 'dart:async';
+
+import 'package:cli_util/cli_logging.dart';
+
+main(List<String> args) async {
+ bool verbose = args.contains('-v');
+ Logger logger = verbose ? new Logger.verbose() : new Logger.standard();
+
+ logger.stdout('Hello world!');
+ logger.trace('message 1');
+ await new Future.delayed(new Duration(milliseconds: 200));
+ logger.trace('message 2');
+ logger.trace('message 3');
+
+ Progress progress = logger.progress('doing some work');
+ await new Future.delayed(new Duration(seconds: 2));
+ progress.finish(showTiming: true);
+
+ logger.stdout('All ${logger.ansi.emphasized('done')}.');
+ logger.flush();
+}
« no previous file with comments | « packages/cli_util/analysis_options.yaml ('k') | packages/cli_util/lib/cli_logging.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698