of static method

Implementation

static FLoggerLabelsExecutionElement? of(FExecutionContext executionContext) {
  final FLoggerLabelsExecutionContext? loggerCtx =
      FExecutionContext.findExecutionContext<FLoggerLabelsExecutionContext>(
          executionContext);

  if (loggerCtx == null) {
    return null;
  }

  final List<FLoggerLabelsExecutionContext> chain = [loggerCtx];
  final prevExecutionContext = loggerCtx.prevContext;
  if (prevExecutionContext != null) {
    chain.addAll(FExecutionContext.listExecutionContexts<
        FLoggerLabelsExecutionContext>(
      prevExecutionContext,
    ));
  }

  return FLoggerLabelsExecutionElement(loggerCtx, chain);
}