1 | "use strict";
|
2 | var __extends = (this && this.__extends) || (function () {
|
3 | var extendStatics = function (d, b) {
|
4 | extendStatics = Object.setPrototypeOf ||
|
5 | ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
6 | function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
|
7 | return extendStatics(d, b);
|
8 | };
|
9 | return function (d, b) {
|
10 | extendStatics(d, b);
|
11 | function __() { this.constructor = d; }
|
12 | d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
13 | };
|
14 | })();
|
15 | Object.defineProperty(exports, "__esModule", { value: true });
|
16 | var tracer_1 = require("./tracer");
|
17 | var noopTracer = new tracer_1.default();
|
18 | var _globalTracer = null;
|
19 |
|
20 |
|
21 |
|
22 |
|
23 |
|
24 |
|
25 |
|
26 |
|
27 |
|
28 |
|
29 |
|
30 | var GlobalTracerDelegate = (function (_super) {
|
31 | __extends(GlobalTracerDelegate, _super);
|
32 | function GlobalTracerDelegate() {
|
33 | return _super !== null && _super.apply(this, arguments) || this;
|
34 | }
|
35 | GlobalTracerDelegate.prototype.startSpan = function () {
|
36 | var tracer = _globalTracer || noopTracer;
|
37 | return tracer.startSpan.apply(tracer, arguments);
|
38 | };
|
39 | GlobalTracerDelegate.prototype.inject = function () {
|
40 | var tracer = _globalTracer || noopTracer;
|
41 | return tracer.inject.apply(tracer, arguments);
|
42 | };
|
43 | GlobalTracerDelegate.prototype.extract = function () {
|
44 | var tracer = _globalTracer || noopTracer;
|
45 | return tracer.extract.apply(tracer, arguments);
|
46 | };
|
47 | return GlobalTracerDelegate;
|
48 | }(tracer_1.default));
|
49 | var globalTracerDelegate = new GlobalTracerDelegate();
|
50 |
|
51 |
|
52 |
|
53 |
|
54 |
|
55 |
|
56 |
|
57 | function initGlobalTracer(tracer) {
|
58 | _globalTracer = tracer;
|
59 | }
|
60 | exports.initGlobalTracer = initGlobalTracer;
|
61 |
|
62 |
|
63 |
|
64 | function globalTracer() {
|
65 |
|
66 |
|
67 |
|
68 |
|
69 | return globalTracerDelegate;
|
70 | }
|
71 | exports.globalTracer = globalTracer;
|
72 |
|
\ | No newline at end of file |