(cb: (s: SentryModule) => void)
| 96 | } |
| 97 | |
| 98 | function withSentry(cb: (s: SentryModule) => void): void { |
| 99 | const s = loadSentrySync(); |
| 100 | if (!s) { |
| 101 | return; |
| 102 | } |
| 103 | try { |
| 104 | cb(s); |
| 105 | } catch { |
| 106 | // Avoid throwing inside logger |
| 107 | } |
| 108 | } |
| 109 | |
| 110 | function mapLogLevelToSentry(level: string): SentryLogLevel { |
| 111 | switch (level.toLowerCase()) { |