hasErrors static method

bool hasErrors(
  1. String name
)

Checks if a tag has any error entries (WARNING/ERROR/CRITICAL).

Returns false in release builds.

Example:

if (Log.hasErrors('auth')) {
  Log.export('auth');
  notifyAdmin();
}

Implementation

static bool hasErrors(String name) {
  var result = false;
  assert(() {
    final entries = _tags[name];
    if (entries != null) {
      result = entries.any((e) => e.isError);
    }
    return true;
  }());
  return result;
}