| 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/http_server.dart'; | 10 import 'package:analysis_server/http_server.dart'; |
| 11 import 'package:analysis_server/src/analysis_server.dart'; | 11 import 'package:analysis_server/src/analysis_server.dart'; |
| 12 import 'package:analysis_server/src/socket_server.dart'; | 12 import 'package:analysis_server/src/socket_server.dart'; |
| 13 import 'package:analysis_server/stdio_server.dart'; | 13 import 'package:analysis_server/stdio_server.dart'; |
| 14 import 'package:analyzer/src/generated/incremental_logger.dart'; | 14 import 'package:analyzer/src/generated/incremental_logger.dart'; |
| 15 import 'package:analyzer/src/generated/java_io.dart'; | 15 import 'package:analyzer/src/generated/java_io.dart'; |
| 16 import 'package:analyzer/src/generated/sdk.dart'; | 16 import 'package:analyzer/src/generated/sdk.dart'; |
| 17 import 'package:analyzer/src/generated/sdk_io.dart'; | 17 import 'package:analyzer/src/generated/sdk_io.dart'; |
| 18 import 'package:args/args.dart'; | 18 import 'package:args/args.dart'; |
| 19 | 19 |
| 20 | 20 |
| 21 /** | 21 /** |
| 22 * Initializes incremental logger. | 22 * Initializes incremental logger. |
| 23 * | 23 * |
| 24 * Supports following formats of [spec]: | 24 * Supports following formats of [spec]: |
| 25 * | 25 * |
| 26 * "console" - log to the console; | 26 * "console" - log to the console; |
| 27 * "file:/some/file/name" - log to the file, overwritten on start. | 27 * "file:/some/file/name" - log to the file, overwritten on start. |
| 28 */ | 28 */ |
| 29 void _initIncrementalLogger(String spec) { | 29 void _initIncrementalLogger(String spec) { |
| 30 logger = new NullLogger(); | 30 logger = NULL_LOGGER; |
| 31 if (spec == null) { | 31 if (spec == null) { |
| 32 return; | 32 return; |
| 33 } | 33 } |
| 34 // create logger | 34 // create logger |
| 35 if (spec == 'console') { | 35 if (spec == 'console') { |
| 36 logger = new StringSinkLogger(console.log); | 36 logger = new StringSinkLogger(console.log); |
| 37 } | 37 } |
| 38 if (spec.startsWith('file:')) { | 38 if (spec.startsWith('file:')) { |
| 39 String fileName = spec.substring('file:'.length); | 39 String fileName = spec.substring('file:'.length); |
| 40 File file = new File(fileName); | 40 File file = new File(fileName); |
| (...skipping 204 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 245 /** | 245 /** |
| 246 * Print information about how to use the server. | 246 * Print information about how to use the server. |
| 247 */ | 247 */ |
| 248 void _printUsage(ArgParser parser) { | 248 void _printUsage(ArgParser parser) { |
| 249 print('Usage: $BINARY_NAME [flags]'); | 249 print('Usage: $BINARY_NAME [flags]'); |
| 250 print(''); | 250 print(''); |
| 251 print('Supported flags are:'); | 251 print('Supported flags are:'); |
| 252 print(parser.usage); | 252 print(parser.usage); |
| 253 } | 253 } |
| 254 } | 254 } |
| OLD | NEW |