fromFlags static method

LogVerbosity fromFlags({
  1. bool silent = false,
  2. bool quiet = false,
  3. bool verbose = false,
})

Resolves the verbosity implied by the global flags.

--silent wins over --quiet, which wins over --verbose, so the most restrictive flag the user typed is always honoured.

Implementation

static LogVerbosity fromFlags({
  bool silent = false,
  bool quiet = false,
  bool verbose = false,
}) {
  if (silent) return LogVerbosity.silent;
  if (quiet) return LogVerbosity.quiet;
  if (verbose) return LogVerbosity.verbose;
  return LogVerbosity.normal;
}