From 50bc5d2c518b9a63097013e9885cf860e2f09ca4 Mon Sep 17 00:00:00 2001 From: thomashii Date: Sun, 18 Jul 2021 14:02:25 +0800 Subject: [PATCH] Added comments --- packages/production/lib/src/options.dart | 2 ++ packages/production/lib/src/runner.dart | 6 ++++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/packages/production/lib/src/options.dart b/packages/production/lib/src/options.dart index 8a7e0eab..06f7bcb0 100644 --- a/packages/production/lib/src/options.dart +++ b/packages/production/lib/src/options.dart @@ -1,7 +1,9 @@ import 'dart:io'; import 'package:args/args.dart'; +/// Options for executing Runner. class RunnerOptions { + /// Command line arguements static final ArgParser argParser = ArgParser() ..addFlag('help', abbr: 'h', help: 'Print this help information.', negatable: false) diff --git a/packages/production/lib/src/runner.dart b/packages/production/lib/src/runner.dart index 2cf78671..5dad59ef 100644 --- a/packages/production/lib/src/runner.dart +++ b/packages/production/lib/src/runner.dart @@ -54,9 +54,10 @@ _ ___ | /| / / /_/ / _ /___ _ /___ '''; + /// LogRecord handler static void handleLogRecord(LogRecord? record, RunnerOptions options) { - if (options.quiet) return; - var code = chooseLogColor(record!.level); + if (options.quiet || record == null) return; + var code = chooseLogColor(record.level); if (record.error == null) print(code.wrap(record.toString())); @@ -214,6 +215,7 @@ _ ___ | /| / / /_/ / _ /___ _ /___ } } + /// Run with main isolate static void isolateMain(_RunnerArgsWithId argsWithId) { var args = argsWithId.args; hierarchicalLoggingEnabled = true;