group<T> method
All logs written while executing the function
will be grouped together.
The group will be closed after it finishes, or in case an exception occurs.
Implementation
Future<T> group<T>(String name, Future<T> Function() function) async {
startGroup(name);
T result;
try {
result = await function();
} finally {
endGroup();
}
return result;
}