detailedConsole method

void detailedConsole({
  1. String name = 'MAGIC EXTENSION',
})

Logs detailed information about the value.

If the value is a Map, logs each key-value pair. If the value is an Iterable, logs each item. Otherwise, falls back to the console method.

  • name: The name of the log entry.

Implementation

void detailedConsole({String name = 'MAGIC EXTENSION'}) {
  if (this is Map) {
    (this as Map).forEach((key, value) {
      log('$key: $value', name: name);
    });
  } else if (this is Iterable) {
    for (var item in this as Iterable) {
      log(item.toString(), name: name);
    }
  } else {
    console(name: name);
  }
}