| OLD | NEW |
| 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, 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 library driver; | 5 library driver; |
| 6 | 6 |
| 7 import 'dart:async'; | 7 import 'dart:async'; |
| 8 import 'dart:io'; | 8 import 'dart:io'; |
| 9 | 9 |
| 10 import 'package:analysis_server/plugin/plugin.dart'; | 10 import 'package:analysis_server/plugin/plugin.dart'; |
| (...skipping 21 matching lines...) Expand all Loading... |
| 32 * "console" - log to the console; | 32 * "console" - log to the console; |
| 33 * "file:/some/file/name" - log to the file, overwritten on start. | 33 * "file:/some/file/name" - log to the file, overwritten on start. |
| 34 */ | 34 */ |
| 35 void _initIncrementalLogger(String spec) { | 35 void _initIncrementalLogger(String spec) { |
| 36 logger = NULL_LOGGER; | 36 logger = NULL_LOGGER; |
| 37 if (spec == null) { | 37 if (spec == null) { |
| 38 return; | 38 return; |
| 39 } | 39 } |
| 40 // create logger | 40 // create logger |
| 41 if (spec == 'console') { | 41 if (spec == 'console') { |
| 42 logger = new StringSinkLogger(console.log); | 42 logger = new StringSinkLogger(stdout); |
| 43 } | 43 } |
| 44 if (spec.startsWith('file:')) { | 44 if (spec.startsWith('file:')) { |
| 45 String fileName = spec.substring('file:'.length); | 45 String fileName = spec.substring('file:'.length); |
| 46 File file = new File(fileName); | 46 File file = new File(fileName); |
| 47 IOSink sink = file.openWrite(); | 47 IOSink sink = file.openWrite(); |
| 48 logger = new StringSinkLogger(sink); | 48 logger = new StringSinkLogger(sink); |
| 49 } | 49 } |
| 50 } | 50 } |
| 51 | 51 |
| 52 | 52 |
| (...skipping 270 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 323 /** | 323 /** |
| 324 * Print information about how to use the server. | 324 * Print information about how to use the server. |
| 325 */ | 325 */ |
| 326 void _printUsage(ArgParser parser) { | 326 void _printUsage(ArgParser parser) { |
| 327 print('Usage: $BINARY_NAME [flags]'); | 327 print('Usage: $BINARY_NAME [flags]'); |
| 328 print(''); | 328 print(''); |
| 329 print('Supported flags are:'); | 329 print('Supported flags are:'); |
| 330 print(parser.usage); | 330 print(parser.usage); |
| 331 } | 331 } |
| 332 } | 332 } |
| OLD | NEW |