| 44 | } |
| 45 | var bridgeHelper = new EdgeBridgeHelper(); |
| 46 | class EdgeBridgeDebugLog { |
| 47 | constructor() { |
| 48 | this.CatchOnException = true; |
| 49 | this.VerboseLogging = true; |
| 50 | this.FailedCalls = {}; |
| 51 | this.SuccededCalls = {}; |
| 52 | this.DeprecatedCalls = {}; |
| 53 | this.BridgedCalls = {}; |
| 54 | this.UnavailableApis = {}; |
| 55 | this.EdgeIssues = {}; |
| 56 | } |
| 57 | log(message) { |
| 58 | try { |
| 59 | if (this.VerboseLogging) { |
| 60 | console.log(message); |
| 61 | } |
| 62 | } |
| 63 | catch (e) { |
| 64 | } |
| 65 | } |
| 66 | info(message) { |
| 67 | try { |
| 68 | if (this.VerboseLogging) { |
| 69 | console.info(message); |
| 70 | } |
| 71 | } |
| 72 | catch (e) { |
| 73 | } |
| 74 | } |
| 75 | warn(message) { |
| 76 | try { |
| 77 | if (this.VerboseLogging) { |
| 78 | console.warn(message); |
| 79 | } |
| 80 | } |
| 81 | catch (e) { |
| 82 | } |
| 83 | } |
| 84 | error(message) { |
| 85 | try { |
| 86 | if (this.VerboseLogging) { |
| 87 | console.error(message); |
| 88 | } |
| 89 | } |
| 90 | catch (e) { |
| 91 | } |
| 92 | } |
| 93 | DoActionAndLog(action, name, deprecatedTo, bridgedTo) { |
| 94 | var result; |
| 95 | try { |
| 96 | result = action(); |
| 97 | this.AddToCalledDictionary(this.SuccededCalls, name); |
| 98 | if (typeof deprecatedTo !== "undefined" && typeof deprecatedTo !== "null") { |
| 99 | this.warn("API Call Deprecated - Name: " + name + ", Please use " + deprecatedTo + " instead!"); |
| 100 | this.AddToCalledDictionary(this.DeprecatedCalls, name); |
| 101 | } |
| 102 | if (typeof bridgedTo !== "undefined" && typeof bridgedTo !== "null") { |
| 103 | this.info("API Call '" + name + "' has been bridged to another Edge API: " + bridgedTo); |
nothing calls this directly
no outgoing calls
no test coverage detected