| OLD | NEW |
| 1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2016, 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 import 'dart:io' as io; | 5 import 'dart:io' as io; |
| 6 | 6 |
| 7 import 'package:args/args.dart'; | 7 import 'package:args/args.dart'; |
| 8 | 8 |
| 9 import 'log/log.dart'; | 9 import 'log/log.dart'; |
| 10 import 'server.dart'; | 10 import 'server.dart'; |
| (...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 111 List<String> lines; | 111 List<String> lines; |
| 112 try { | 112 try { |
| 113 lines = logFile.readAsLinesSync(); | 113 lines = logFile.readAsLinesSync(); |
| 114 } catch (exception, stackTrace) { | 114 } catch (exception, stackTrace) { |
| 115 printUsage(parser, | 115 printUsage(parser, |
| 116 error: 'Could not read file "$fileName":', | 116 error: 'Could not read file "$fileName":', |
| 117 exception: exception, | 117 exception: exception, |
| 118 stackTrace: stackTrace); | 118 stackTrace: stackTrace); |
| 119 return; | 119 return; |
| 120 } | 120 } |
| 121 print('Log file contains ${lines.length} lines'); |
| 121 | 122 |
| 122 InstrumentationLog log = | 123 InstrumentationLog log = |
| 123 new InstrumentationLog(<String>[logFile.path], lines); | 124 new InstrumentationLog(<String>[logFile.path], lines); |
| 124 WebServer server = new WebServer(log); | 125 WebServer server = new WebServer(log); |
| 125 server.serveHttp(port); | 126 server.serveHttp(port); |
| 126 print('logViewer is listening on http://localhost:$port/log'); | 127 print('logViewer is listening on http://localhost:$port/log'); |
| 127 } | 128 } |
| 128 } | 129 } |
| OLD | NEW |