Line data Source code
1 : // Licensed under the Apache License, Version 2.0
2 : // Copyright 2025, Michael Bushe, All rights reserved.
3 :
4 : part of 'tracer.dart';
5 :
6 : /// Factory for creating Tracer instances.
7 : ///
8 : /// This factory class provides a static create method for constructing
9 : /// properly configured Tracer instances. It follows the factory pattern
10 : /// to separate the construction logic from the Tracer class itself.
11 : class SDKTracerCreate {
12 : /// Creates a new Tracer with the specified delegate, provider, and optional sampler.
13 : ///
14 : /// @param delegate The API Tracer implementation to delegate to
15 : /// @param provider The TracerProvider that created this Tracer
16 : /// @param sampler Optional custom sampler for this Tracer
17 : /// @return A new APITracer instance (actually a Tracer implementation)
18 29 : static APITracer create(
19 : {required APITracer delegate,
20 : required TracerProvider provider,
21 : Sampler? sampler}) {
22 29 : return Tracer._(delegate: delegate, provider: provider, sampler: sampler);
23 : }
24 : }
|