toJson method
Implementation
Map<String, dynamic> toJson() => {
'global': global.toJson(),
if (mainThread != null) 'main': mainThread!.toJson(),
if (byThread.isNotEmpty)
'thread': byThread.map((k, v) => MapEntry(k, v.toJson())),
};