Quellcode durchsuchen

Add SaltyRTC log level to config and apply it to the WebRTC task

Lennart Grahl vor 7 Jahren
Ursprung
Commit
cc94d0fe19
4 geänderte Dateien mit 6 neuen und 4 gelöschten Zeilen
  1. 2 2
      package.json
  2. 1 0
      src/config.ts
  3. 2 2
      src/services/webclient.ts
  4. 1 0
      src/threema.d.ts

+ 2 - 2
package.json

@@ -26,9 +26,9 @@
   "private": true,
   "homepage": "https://threema.ch/",
   "dependencies": {
-    "@saltyrtc/client": "^0.13.0",
+    "@saltyrtc/client": "^0.13.1",
     "@saltyrtc/task-relayed-data": "^0.3.1",
-    "@saltyrtc/task-webrtc": "^0.12.1",
+    "@saltyrtc/task-webrtc": "^0.13.0",
     "@types/angular": "^1.6.50",
     "@types/angular-material": "^1.1.59",
     "@types/angular-sanitize": "^1.3.7",

+ 1 - 0
src/config.ts

@@ -20,6 +20,7 @@ export default {
     SALTYRTC_HOST_SUFFIX: '.threema.ch',
     SALTYRTC_PORT: 443,
     SALTYRTC_SERVER_KEY: 'b1337fc8402f7db8ea639e05ed05d65463e24809792f91eca29e88101b4a2171',
+    SALTYRTC_LOG_LEVEL: 'warn',
 
     // ICE
     ICE_SERVERS: [{

+ 2 - 2
src/services/webclient.ts

@@ -438,7 +438,7 @@ export class WebClientService {
 
         // Create WebRTC task instance
         const maxPacketSize = this.browserService.getBrowser().isFirefox(false) ? 16384 : 65536;
-        this.webrtcTask = new saltyrtcTaskWebrtc.WebRTCTask(true, maxPacketSize);
+        this.webrtcTask = new saltyrtcTaskWebrtc.WebRTCTask(true, maxPacketSize, this.config.SALTYRTC_LOG_LEVEL);
 
         // Create Relayed Data task instance
         this.relayedDataTask = new saltyrtcTaskRelayedData.RelayedDataTask(this.config.DEBUG);
@@ -470,7 +470,7 @@ export class WebClientService {
         // Create SaltyRTC client
         let builder = new saltyrtcClient.SaltyRTCBuilder()
             .connectTo(this.saltyRtcHost, this.config.SALTYRTC_PORT)
-            .withLoggingLevel('warn')
+            .withLoggingLevel(this.config.SALTYRTC_LOG_LEVEL)
             .withServerKey(this.config.SALTYRTC_SERVER_KEY)
             .withKeyStore(keyStore)
             .usingTasks(tasks)

+ 1 - 0
src/threema.d.ts

@@ -628,6 +628,7 @@ declare namespace threema {
         SALTYRTC_HOST: string | null;
         SALTYRTC_HOST_PREFIX: string | null;
         SALTYRTC_HOST_SUFFIX: string | null;
+        SALTYRTC_LOG_LEVEL: saltyrtc.LogLevel;
         ICE_SERVERS: RTCIceServer[];
         PUSH_URL: string;
         DEBUG: boolean;