context property
A custom label for the current isolate or execution context.
Set this at the start of each isolate to identify where logs come from. Displayed inside the square brackets of the log output.
Dart statics are per-isolate, so each isolate gets its own value.
void main() {
Log.context = 'MAIN';
runApp(const App());
}
@pragma("vm:entry-point")
void overlayMain() {
Log.context = 'OVERLAY';
runApp(const Overlay());
}
Implementation
static String? context;