fromString static method

LogType fromString(
  1. String name
)

Returns the LogType corresponding to the given name.

If the name does not match any LogType, an InvalidArgumentException is thrown.

Implementation

static LogType fromString(String name) {
  return LogType.values.firstWhere((e) => e.name.equalsIgnoreCase(name))
    .getOrThrow("Invalid log type: $name. Available log types: ${LogType.values.map((e) => e.name).join(", ")}");
}