registerWorker<T extends LoggerWorker> static method
Registers a worker creator with a unique identifier.
id is the unique identifier for the worker type.
workerCreator is the function that creates the worker.
Implementation
static void registerWorker<T extends LoggerWorker>(
String id,
WorkerCreator workerCreator,
) {
if (workers.containsKey(id)) {
throw Exception('Worker with id $id is already registered.');
}
workers[id] = workerCreator;
}