hasTag static method

bool hasTag(
  1. String name
)

Checks if a tag has any logged entries.

Returns false in release builds (no entries are ever stored).

Example:

if (Log.hasTag('auth')) {
  Log.export('auth');
}

Implementation

static bool hasTag(String name) {
  var result = false;
  assert(() {
    result = _tags.containsKey(name) && _tags[name]!.isNotEmpty;
    return true;
  }());
  return result;
}